Mainly, i need the conditions is registred, is unregistred, is thread x, is forum y, is usegroup z!
<xen:if is="{$thread.thread_id} == 1">
test
</xen:if>
<xen:if is="{$forum.node_id} == 2">
test
</xen:if>
Registered and unregistered:
http://xenforo.com/community/threads/1-0-0-b1-member-guest-template-condition.5566/
Group checking:
http://xenforo.com/community/threads/usergroup-checking-in-the-templates.9447/
<xen:if is="{$visitor.message_count} == 0">
Welcome, new user! Please introduce yourself here!
</xen:if>
Wondering how to "NOT" display things in certain forums...
I know how to do that, but the thing is how do I use it in page container? Since I've heard that you can only use it in "forum_view".
By the way I am talking about this condition...
<xen:if is="{$forum.node_id} == 2"> test </xen:if>
So here is the deal, I need to display ads globally, but I do not want to display them in certain forums, since they would most likely violate the ad's TOS, thats why I am trying to use template conditions so they are not displayed on these pages.
So if Anyone has an idea of how to do this please let me know. Again I need to use this in Page_Container, and in thread_view I think.
<xen:if is="!in_array({$forumId}, array(1,2,3))">
AD CODE HERE
</xen:if>
See this post:
http://xenforo.com/community/threads/language-attribute.15249/#post-200171
The instructions are the same for you, except at the end when you edit PAGE_CONTAINER. Use this code:
Rich (BB code):<xen:if is="!in_array({$forumId}, array(1,2,3))"> AD CODE HERE </xen:if>
This condition will make it so the ad code does not display in forums 1, 2, and 3. Specify the node_ids of your excluded forums.
That is perfect, its working for me, just another question how would you be able to do this with categories.
<xen:container var="$forumId">{$forum.parent_node_id}</xen:container>
Also, the threads within these forums are still displaying the ads,...
How do you make it so the threads within the forums that I do not want ads displayed do not display ads as well.
When you edit forum_view and thread_view, use this code instead to pass the parent_node_id:
Code:<xen:container var="$forumId">{$forum.parent_node_id}</xen:container>
Make sure you edited both forum_view and thread_view, per that post:
http://xenforo.com/community/threads/language-attribute.15249/#post-200171
<xen:container var="$forumId">{$forum.parent_node_id}</xen:container>
<xen:container var="$forumId">{$forum.node_id}</xen:container>
Just another question, I also have ads displaying in threads, right after the first message.
This is in the "message" template, and I pretty much want to exclude it from some of the forums that violate the AD tos, pretty much what we did with Page_Container, I just tried the same thing that I did with page_contrainer, and it didn't work. So if you could please help me with that part as well.
<xen:if is="!in_array({$thread.node_id}, array(1,2,3))">
AD CODE HERE
</xen:if>
<xen:if is="{$category.node_id} != 3">
</xen:if>
<xen:if is="!in_array({$category.node_id}, array(1,3,5))">
</xen:if>
Registered and unregistered:
Forumid checking (works in forum_view):
Code:<xen:if is="{$forum.node_id} == 2"> test </xen:if>
We use essential cookies to make this site work, and optional cookies to enhance your experience.