Textpattern CMS Template Tags

<txp:password_protect /> single tag, 2 attributes

password_protect

The password_protect tag is a single tag. When Textpattern encounters the password protect tag it causes the user to be prompted for username and password, if these match the attributes set in the tag, the user is allowed access to the site. The tag can go anywhere, from page template, to article and forms.

attributes

login="unset" 
  • The username the user has to enter.
pass="unset" 
  • The password the user has to enter.
<txp:password_protect /> 1 examples

Cause Textpattern to prompt the user for a login

<txp:password_protect login="theuser" pass="thepassword" /> 

Note: It is not adequate to protect a single section. This is not due to the tag itself, but rather because of how Textpattern handles URLs. By changing the URL an article can be rendered with a different section template, which would mean that the tag in the protected section would not be rendered and could not protect the article – only page requests that would be rendered in that section would be protected.