show in all pages except the login page

Jake Bunce

XenForo moderator
Staff member
Which template are you working with? This condition will probably work for you:

Code:
<xen:if is="{$contentTemplate} != 'login'">
	YOUR MESSAGE
</xen:if>
 

kkm323

Well-known member
Which template are you working with? This condition will probably work for you:

Code:
<xen:if is="{$contentTemplate} != 'login'">
	YOUR MESSAGE
</xen:if>
A New template I want the message to show in the entire site but not on the login page
 

Jake Bunce

XenForo moderator
Staff member
If {$contentTemplate} is available to your template then the condition will work. You can test it by pasting {$contentTemplate} into your template to see if it outputs anything.
 

kkm323

Well-known member
If {$contentTemplate} is available to your template then the condition will work. You can test it by pasting {$contentTemplate} into your template to see if it outputs anything.
this seem to do half of the trick it works in the login page, but not affective in "site.com/login/login" this url appears if you enter any wrong data in the login form.

thank you for the great support by the way
 

Jake Bunce

XenForo moderator
Staff member
Use this new code:

Code:
<xen:if is="{$contentTemplate} != 'login' AND {$contentTemplate} != 'error_with_login'">
	YOUR MESSAGE
</xen:if>
 

kkm323

Well-known member
Use this new code:

Code:
<xen:if is="{$contentTemplate} != 'login' AND {$contentTemplate} != 'error_with_login'">
YOUR MESSAGE
</xen:if>
I think they should change your title from "Probably knows the answer" to "knows the answer" :D

Now is it also possible to add pages like "/account-confirmation" and/or "lost-password/lost" to the list?

thanks again
 

Jake Bunce

XenForo moderator
Staff member
Use this syntax to specify a list of pages:

Code:
<xen:if is="!in_array({$contentTemplate}, array('login', 'error_with_login', 'register_confirm', 'lost_password'))">
	YOUR MESSAGE
</xen:if>
 

kkm323

Well-known member
Use this syntax to specify a list of pages:

Code:
<xen:if is="!in_array({$contentTemplate}, array('login', 'error_with_login', 'register_confirm', 'lost_password'))">
YOUR MESSAGE
</xen:if>
I love what you did and I'm starting to learn a pattern, but how can i add 'lost_password' in a way that it also include anything within that directory
 

Jake Bunce

XenForo moderator
Staff member
I love what you did and I'm starting to learn a pattern, but how can i add 'lost_password' in a way that it also include anything within that directory
What other locations are you talking about? They must all be explicitly defined.
 
Top