• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 2.0 Xen IF Statements inside Ad Manager


Active member
It appears the following code will not work inside of the HTML part of inserting an ad. I am trying to bypass some Forums I do not want the code in.

<xf:if is="!in_array({$forum.node_id}, [228, 305, 308, 309, 310, 316, 341, 317, 49, 62, 253, 232, 81, 45, 319, 265])">
If I dump the code I get NULL. I have to assume maybe the forum node variable cannot be passed here or is there other code I could use?

With the ! (not) part in the code, the code inside the IF will ALWAYS display. If I remove the ! (not) then the code will not display period.

This code works in a template in the <HEAD> of the Page Container, just not inside an Ad.



Chris D

XenForo developer
Staff member
Change {$forum.node_id} to $forum.node_id.

That should work depending on whether the $forum variable is available or not.

If it doesn't work, try: $__globals.forum.node_id.