XF 1.5 Placing ad on "resource page" but hide it on it's thread

Greetings everyone. I'm working on my forum almost for one month.

A few days ago I started placing ads and placed an ad on resource_view_header template just before
<xen:hook name="resource_view_header_after_info" /> code.

Problem is my "normal" (not the resources' one) threads already got 3 adsense ads and with this ad there is 4 adsense ads on resource's threads.

I want to hide this ad from thread_view template but code is'nt working. I'm using this conditional to hide it from threads but it'snt working:
Code:
<xen:if is="!in_array({$contentTemplate}, array('thread_view'))">
AD CODE WAS HERE
</xen:if>

Please help me in this case. @Brogan @Chris D @Mike
 
Greetings everyone. I'm working on my forum almost for one month.

A few days ago I started placing ads and placed an ad on resource_view_header template just before
<xen:hook name="resource_view_header_after_info" /> code.

Problem is my "normal" (not the resources' one) threads already got 3 adsense ads and with this ad there is 4 adsense ads on resource's threads.

I want to hide this ad from thread_view template but code is'nt working. I'm using this conditional to hide it from threads but it'snt working:
Code:
<xen:if is="!in_array({$contentTemplate}, array('thread_view'))">
AD CODE WAS HERE
</xen:if>

Please help me in this case. @Brogan @Chris D @Mike

You can check for resource threads with this code. And add the not true operator which will hide it from resource threads.

HTML:
<xen:if is="!{$thread}">
Add code
</xen:if>
 
Don't put the ad in the header template, just put it in the resource template.
I added ad code to the resource_view_header. Just above of <xen:hook name="resource_view_header_after_info" /> code.
You can check for resource threads with this code. And add the not true operator which will hide it from resource threads.

HTML:
<xen:if is="!{$thread}">
Add code
</xen:if>
When I include ad code between these code, it hides that ad on both resource and resource thread pages.
 
.

When I include ad code between these code, it hides that ad on both resource and resource thread pages.

My apologies sir. I had not tested the code. Please try this code instead. It is tested and it does what you want. It will show the ads on resources, but it will hide it on all threads.

HTML:
<xen:if is="{$controllerName} != 'XenForo_ControllerPublic_Thread'">
Ad code
</xen:if>
 
Top Bottom