• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Conditional Statements for XenForo 2

Conditional Statements for XenForo 2

To get some variables to work in all ad positions, they need to be referenced as global like {$__globals.forum.node_id} instead of forum.node_id
Looking for a conditional statement for thread view that combines two requirement.
Not to appear in particular forum <xf:if is="{$__globals.forum.node_id} != XXX">
Only appear if thread has more than Y number of posts.


Well-known member
Did anyone have luck with detecting the default dynamic avatars? This would be good to have!
<xf:if is="$xf.visitor.getAvatarType() == 'default'">content</xf:if>
Hi there, I have read all the comments and everything but still haven't figured out how to add a widget to a specific thread, say thread number 5662

Any help?

1. Create the widget you want to show in that thread with no position set.
2. Put this in a html widget in the Thread view: Sidebar position.
<xf:if is="$context.thread.thread_id == 5662">
    <xf:widget key="widget_key" />
3. Replace widget_key with the widget key you made in step 1.
4. Check advanced mode and save.