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

XF 1.4 Including templates, if they exist, based on variable names.

Jawsh

Formerly null0
#1
I would like to include a template before and after every node and category if they exist.

- include category_before_{$node.id}
- include category
- - include node_before_{$node.id}
- - include node
- - include node_after_{$node.id}
- include category_after_{$node.id}

So, unless (for instance) catagory_after_32 exists, it does nothing.
But if it does exist, go on to include its content.

Is this possible? Is there a better way to do this task?
 

j0e

New member
#2
Would it be easier to create a conditional statement?
Code:
<xen:if is="{$forum.node_id}">
          <xen:include template="template_name" />
</xen:if>
 

Jawsh

Formerly null0
#3
I was hoping to be able to do

Code:
<xen:if is="{$forum.node_id}">
          <xen:include template="template_name_{$forum.node_id}" />
</xen:if>