It works for me exactly as explained in the update: https://xenforo.com/community/resources/conditional-statements.1604/update?update=5021








Are you sure the variable is correct / node_id exists in that template?
I have the category node id's right. Here is the rest of my implementation, and a test, where the category variable is showing nothing.That's what this does: https://xenforo.com/community/resources/conditional-statements.1604/update?update=5021
My guess is the wrong node IDs are being used - check the value in the address bar in the ACP when editing the category.
<xen:if is="!{$visitor.user_id} AND ({$contentTemplate} != 'error' OR {$contentTemplate} != 'member_view')">
<xen:if is="!{$visitor.user_id} AND !in_array({$contentTemplate}, array('member_view', 'error')">
What is the conditional for Media Gallery Categories please?26. How can I show content in a specific category?
<xen:if is="{$category.node_id} == x">
This content will show in category x
</xen:if>
Try this on your local installationI'm using this, but it isn't working. Confirmed category is 498 too.
Code:<xen:if is="{$category.node_id} == 498"> testing </xen:if>
If forum_view the correct template?
{xen:helper dump, $category}
Yea that's what I ended up doing.Using the user ID is just as good in this instance - you can use an array for multiple IDs.
24. How can I show content on a specific page?
<xen:if is="{$contentTemplate} == 'xyz'">
This content will show on the xyz template
</xen:if>
How can I BLOCK content from a specific page? (ie: Login)
<xen:if is="{$contentTemplate} != 'xyz'">
Content
</xen:if>
Code:<xen:if is="{$contentTemplate} != 'xyz'"> Content </xen:if>
<xen:if is="!{xen:helper ismemberof, $visitor, 5} AND !in_array({$contentTemplate}, array('member_view', 'message_page', 'error', 'search_form', 'search_form_post', 'search_form_profile_post', 'search_results', 'register_form', 'register_facebook', 'register_twitter', 'register_google', 'login', 'login_two_step', 'error_with_login', 'contact'))
">
CODE
</xen:if>
https://xenforo.com/community/resources/conditional-statements.1604/I was wondering if anyone can point in the right direction for showing code/ads in sidebar area but only on category pages and not on thread pages or conversation/private pages ?
tried something like this in my template which is called from bd widget advance html
doesn't seem to be working thoughCode:<xen:if is="!{xen:helper ismemberof, $visitor, 5} AND !in_array({$contentTemplate}, array('member_view', 'message_page', 'error', 'search_form', 'search_form_post', 'search_form_profile_post', 'search_results', 'register_form', 'register_facebook', 'register_twitter', 'register_google', 'login', 'login_two_step', 'error_with_login', 'contact')) "> CODE </xen:if>
26. How can I show content in a specific category?
<xen:if is="{$category.node_id} == x">
This content will show in category x
</xen:if>
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.
Additionally, to ensure the category ID is available in the ad_* templates, the category_view template must be edited and the following code added: <xen:container var="$category.node_id">{$category.node_id}</xen:container>
<xen:if is="!{xen:helper ismemberof, $visitor, 21}">
<center>
<!-- BEGIN SECURE JS TAG - 300x250 -->
<!--DO NOT MODIFY-->
<SCRIPT SRC="https://secureads.digitalthrottle.com/ttj?id=3106679&cb=[CACHEBUSTER]&referrer=forabodiesonly.com" TYPE="text/javascript"></SCRIPT>
<!-- END TAG -->
</center>
</xen:if>
We use essential cookies to make this site work, and optional cookies to enhance your experience.