Posted on 03/03/2014 09:46:27
There's no built-in template tag for checking if a page is password protected.
You have at least three options to work around this
- Use a condition to check if some unique string that (with very high probability) only occurs in your login form occurs in the page content (see below)
- Create a page template extender (check Page.Protect and Page.Password)
- Use Razor in your layout template to check if the page is password protected
I recommend going for number 3.
For number 1 you can add
<!--SomeStringThatOnlyOccursInTheLoginForm-->
to your login template and then check for this in your master template
<!--@If(DwContent(content)<contains>SomeStringThatOnlyOccursInTheLoginForm)-->
<pre>This page is protected by a password</pre>
<!--@EndIf-->
(replace "content" with the id of the first content placeholder in your layout). It's a hack, but it works.
Best regards,
Mikkel