Conditional not being evaluated in Advertising System

lantek

Active member
#1
OK thanks. I'm outside of ticket support scope now, so have been asked to post in the forum.

If using the 'Container Breadcrumb (top): Above' ad unit, would there be any alternative to making the following work?

<xf:if is="{$forum.node_id} == 4">
content here
</xf:if>

Many thanks for any help.
 

Brogan

XenForo moderator
Staff member
#5
To add some context and to reiterate what I said in the ticket, you can check what params/variables are available in the template by adding this to the ad unit:
Code:
{{ dump(vars()) }}
Then searching for node_id on the page gives this:

1512060168451.png

However, $forum is not available in that form but if you scroll up you can see it is within __globals:
1512060258877.png

So the full param is __globals.forum.node_id.
 

lantek

Active member
#6
To add some context and to reiterate what I said in the ticket, you can check what params/variables are available in the template by adding this to the ad unit:
Code:
{{ dump(vars()) }}
Then searching for node_id on the page gives this:

View attachment 162890

However, $forum is not available in that form but if you scroll up you can see it is within __globals:
View attachment 162891

So the full param is __globals.forum.node_id.
Thanks, very helpful!
 

Russ

Well-known member
#7
Bumping this thread as I'm using the advertisement system as well.

Is there a conditional for finding the parent category like XF1? I'm not seeing any reference to parent/category when dumping the vars aside from a breadcrumb reference.
 
Top