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

XF 1.2 Is there a list of template conditionals?

Code Monkey

Well-known member
#1
How would I check if the template used is one of 5 templates using conditionals? Say I have a list of templates and I only want to display something if I am viewing the pages that use those templates.

Code:
thisapp_public_index
thisapp_public_page1
thisapp_public_page2
thisapp_public_page3
member_view
 

Code Monkey

Well-known member
#3
Thanks

So something like this might work?

Code:
<xen:if is="in_array({$contentTemplate}, array(thisapp_public_index, thisapp_public_page1, thisapp_public_page2, thisapp_public_page3, member_view))">
    //display the stuff
</xen:if>
 

Code Monkey

Well-known member
#6
Ahh this works. Need to quote the template names.

Code:
<xen:if is="in_array({$contentTemplate}, array('thisapp_public_index', 'thisapp_public_page1', 'thisapp_public_page2', 'thisapp_public_page3', 'member_view'))">
   //display the stuff
</xen:if>