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

XF 1.4 Conditional for Resource pages

Discussion in 'XenForo Questions and Support' started by popowich, Jun 4, 2015.

  1. popowich

    popowich Active Member

    What's the conditional for resource pages?

    For example, I use this one related to the home page:

    <xen:if is="{$contentTemplate} == 'forum_list'">

  2. popowich

    popowich Active Member

    Also related to resources, is there a permission that turns off the behavior that cuts off resource page content for visitors?

    I don't see anything in the group permissions.
  3. Brogan

    Brogan XenForo Moderator Staff Member

    The FAQ in my signature explains how to identify the template name.

    The content limit is set here:
  4. popowich

    popowich Active Member

    I wonder if Brogan's mind is going "Yeah, can't stop posting questions from the FAQ! (but thanks for the posts)" <sarcasm>

    xenforo can't stop.jpg
  5. Brogan

    Brogan XenForo Moderator Staff Member

    Just noticed the image didn't attach in the previous post for some reason.

    So here it is...
    popowich likes this.
  6. popowich

    popowich Active Member

    For anyone else who needs this, here is an answer:

    <xen:if is="{$contentTemplate} == 'forum_list' OR {$contentTemplate} == 'resource_description'">

    Maybe it was doable with an array too, like this syntax with the correct template names:

    <xen:if is="!in_array({$contentTemplate}, array('message_page', 'error', 'search_form', ......
  7. Brogan

    Brogan XenForo Moderator Staff Member

    Either approach will work.

    Arrays are probably more useful for three or more templates.

Share This Page