R rdn Well-known member Jul 21, 2013 #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>
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>
P Paul B XenForo moderator Staff member Jul 21, 2013 #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. Upvote 0 Downvote
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.
R rdn Well-known member Jul 21, 2013 #4 And I'm using the condition inside ad_ templates, ad_below_content / top both not working. Upvote 0 Downvote
P Paul B XenForo moderator Staff member Jul 21, 2013 #5 Can you post a link to the category? Upvote 0 Downvote
R rdn Well-known member Jul 21, 2013 #6 Brogan said: Can you post a link to the category? Click to expand... It's hidden section. I can PM you. Upvote 0 Downvote
Brogan said: Can you post a link to the category? Click to expand... It's hidden section. I can PM you.
P Paul B XenForo moderator Staff member Jul 21, 2013 #8 Just checked the source code and the node id is 159. Upvote 0 Downvote
R rdn Well-known member Jul 21, 2013 #9 It's not a category? it's a node? My 1st post is just an example. Upvote 0 Downvote
Jeremy in memoriam 1991-2020 Jul 21, 2013 #10 Categories are a type of node in XenForo, just like pages, link forums, and forums. Upvote 0 Downvote
P Paul B XenForo moderator Staff member Jul 21, 2013 #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 Upvote 0 Downvote
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
R rdn Well-known member Jul 21, 2013 #12 Thanks for the help @Brogan and @Chris Deeming and also @King Kovifor It works now as expected Upvote 0 Downvote