1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

show in all pages except the login page

Discussion in 'Styling and Customization Questions' started by kkm323, Nov 10, 2011.

  1. kkm323

    kkm323 Well-Known Member

    What variable should I use to show a message to all pages but not in the login page
     
  2. Jake Bunce

    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 likes this.
  3. kkm323

    kkm323 Well-Known Member

    A New template I want the message to show in the entire site but not on the login page
     
  4. Jake Bunce

    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 likes this.
  5. kkm323

    kkm323 Well-Known Member

    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
     
  6. Jake Bunce

    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 likes this.
  7. kkm323

    kkm323 Well-Known Member

    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
     
  8. Jake Bunce

    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>
    
     
  9. kkm323

    kkm323 Well-Known 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
     
  10. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    What other locations are you talking about? They must all be explicitly defined.
     
    kkm323 likes this.

Share This Page