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

XF 1.4 Hide Ads in X Forum?

Michael

Active member
#1
I am wanting to hide ads in a specific forum and from all threads within that forum, the templates I use are a couple of the ad templates and my own custom template which is grabbed within the thread_view template.

Anyone know how to do this I have tried with this:
<xen:if is="!{$forum.node_id} == 44">

But that only works in some templates.

Thank you.
 

Brogan

XenForo moderator
Staff member
#2
Which ad templates are you using that in?

It will only work if the parameter is available in the template.
 

Michael

Active member
#3
I have tried adding this to the top of the thread_view template in the <head>:

<xen:container var="$forumId">{$forum.node_id}</xen:container>

and then using the

<xen:if is="!{$forum.node_id} == 44">

But it doesnt appear to have any effect and hides the content within all nodes instead of the one.
 

Michael

Active member
#5
Thank you so much Brogan, do you know how to make that work for multiple forums to hide ads in those too? It works perfectly now, I also moved the container code to the top of the page_container template.