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

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

RoldanLT

Well-known member
#1
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>
 

Brogan

XenForo moderator
Staff member
#2
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.
 

Brogan

XenForo moderator
Staff member
#11
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