XF 2.0 Add Content between Categories XF2

ali_00080

Member
Hi, I'm looking to add content in the gap between 2 categories on XF2 and I can't seem to think of the code to insert and where to.
Any help would be appreciated :)


Used to have something like this in XF1 in node_category_level_1

<xen:if is="{$category.node_id} == 1">
BANNER CODE HERE
</xen:if>
 
Last edited:
Just to update this as I didn't see a confirmed answer.

In the template forum_list you have this part:
HTML:
<xf:macro id="node_list" arg-children="!" arg-extras="!" arg-depth="1">
    <xf:css src="node_list.less" />
    <xf:foreach loop="$children" key="$id" value="$child">
        <xf:macro id="node_list_entry"
            arg-node="{$child.record}"
            arg-extras="{$extras.{$id}}"
            arg-children="{$child.children}"
            arg-childExtras="{$extras}"
            arg-depth="{$depth}" />
    </xf:foreach>
</xf:macro>

Simply add an if statement in the foreach
HTML:
<xf:macro id="node_list" arg-children="!" arg-extras="!" arg-depth="1">
    <xf:css src="node_list.less" />
    <xf:foreach loop="$children" key="$id" value="$child">
        <xf:macro id="node_list_entry"
            arg-node="{$child.record}"
            arg-extras="{$extras.{$id}}"
            arg-children="{$child.children}"
            arg-childExtras="{$extras}"
            arg-depth="{$depth}" />
        
        <xf:if is="$child.record.node_id == 1">
            <p>Your bit goes here.</p>
        </xf:if>
    </xf:foreach>
</xf:macro>
Then your section will now render under the category with the id of 1
 
Back
Top Bottom