XF 1.1 Xenforo conditionals question

  • Thread starter Thread starter bogus
  • Start date Start date
B

bogus

Guest
I remember Brogan had opened a Thread where all the xen:if conditionals where listed. I cant find that Thread anymore, also on Help Page i dont see it.

What i am trying to do is to hide all Google Adsense on xenporta index Page, so i guess i need something like "if index page -> hide google ads -> else show Layer Ad"

Maybe anyone knows where that Thread is hiding ;) Or much better anyone can help me with the Ads. Cheers ;9
 
<xen:if is="{$controllerName} == 'EWRporta_ControllerPublic_Portal'">
Hide Google Ads
<xen:else />
Show Layer Ad
</xen:if>

My mistake.

I believe the correct controller is EWRporta_ControllerPublic_Portal
 
Edit: Works ;) Thank you so much.
Its <xen:if is="{$controllerName} != 'EWRporta_ControllerPublic_Portal'">
Dont know why. But it is working at the end.
 
We're both right :p Though my example was slightly misleading. My example in reality should look like this:

Rich (BB code):
<xen:if is="{$controllerName} == 'EWRporta_ControllerPublic_Portal'">
<xen:else />
Ad Code
</xen:if>

If it's the Portal it displays nothing. Anything else it displays the code.

I'm guessing yours looks something like:

Rich (BB code):
<xen:if is="{$controllerName} != 'EWRporta_ControllerPublic_Portal'">
Ad Code
</xen:if>

So if it is not the Portal it displays the ad code.

Both work, so either is fine. But just so you know the difference :)
 
Is it possible to add two restrictions?

I dont want Google Ads to be displayed on the Portals Page which is solved (thanks a lot) and none on the Login Page, because Google Adsense seems not to like Login Pages. I just get 2 blue boxes.
So, i could add the Adlayers there?
Thanks for every help
 
Based on the previous code which worked for you, this should now work.

<xen:if is="{$controllerName} != 'EWRporta_ControllerPublic_Portal' AND {$controllerName} != 'XenForo_ControllerPublic_Login'">
Ad Code
</xen:if>
 
Thanks Jake, i was playing around and ended up with a Layer Ad i want to popup here http://www.brainlag.eu/pages/bnc_rules/
Its a Page and in ACP Edit i do have that URL http://www.brainlag.eu/admin.php?nodes/brainlag-bnc-rules.190/


I have now tried that
<xen:if is="{$contentTemplate} == 'bnx_rules'"><script type="text/javascript" src="http://view.binlayer.com/ad-55***.js">
<xen:else />
Google Adsense
</xen:if>
cause url portion is bnc_rules, i also tried
<xen:if is="{$contentTemplate} == 'brainlag-bnc-rules'"><script type="text/javascript" src="http://view.binlayer.com/ad-55***.js">
</script><xen:else />
Google Adsense
</xen:if>
because the 1. Example did not worked. After both did not do it, i´ve tried to play with the node number

<xen:if is="{$threadId} == x">

<xen:if is="{$threadId} == 190">
<script type="text/javascript" src="http://view.binlayer.com/ad-55***.js"></script>
<xen:else />

Google Adsense
</xen:if>

But all of them wont do it, maybe anyone can help me one more time? Thanks!

 
You can't use the contentTemplate to uniquely identify a page node.

Threadid checking also doesn't work in the container because the thread record isn't available there. But you can do it in the thread_view template:

Code:
<xen:if is="{$thread.thread_id} == 1">
	test
</xen:if>
 
Top Bottom