XF 1.1 Category under a Parent category, xen:if is not working

rdn

Well-known member
My Forum structure:

Main category1
Forum2
Forum3
Category4
Forum5​

I have this code to hide on a certain category.
PHP:
<xen:if is="{$category.node_id} != 4">
This content will not show in category 4
</xen:if>
 
From the FAQ:

Note that in order for this to work, you must have categories set as pages in the ACP -> Options -> Node & Forum List: Create Pages for Categories.
 
Just to follow up on this, the category node ID isn't available in the ad templates.

To make it available you have to add this to the category_view template:
Code:
<xen:container var="$category.node_id">{$category.node_id}</xen:container>

Big thanks to @Chris Deeming for the solution.
Wish I'd asked him sooner instead of wasting time trying to get my incorrect xen:container code working :D
 
  • Like
Reactions: rdn
Top Bottom