Different Ads in Different Forums (Nodes)

lazer

Well-known member
Hey all

Is there a way to place a banner or ad in a particular forum (thread_view) with a conditional?

Simply put:

I would like to have banner "A" in forum 1,2,3 & 5
I would like to have banner "B" in forum 4

So, some kind of "if" statement? I'm not really keen on installing an add-on to achieve this, if it can be avoided...

Cheers.
 
Absolutely.

Code:
<xen:if is="in_array({$forum.node_id}, array(1, 2, 3, 5))">
Banner A
<xen:elseif is="{$forum.node_id} == 4 AND !{$visitor.user_id}" />
Banner B
</xen:if>

That's just an example where if you're in forum ID 4 AND a guest then you will see banner B.

Lots of other combinations too. I'm sure you'll work it out :) But let us know if you need anything else.
 
FYI, I am doing the above by calling an outside ad banner program - with a variable that depicts the node.

This is useful if you have rotating ads in each forum as opposed to just a fixed banner.
 
Top Bottom