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

Ad content depending on width avaliable

Lu Kas

Active member
#1
Hi,

i know the thread title is woot? (brogan feel free to change it) but i have no idea what would fit better. i would like to use the template ad_above_content and ad_below_content, but on my mainpage the forumwidth (width minus sidebar) is just 690 so i cant use 720 banners. on all the other pages the small banner looks ridiculously small :) .

so is there a small code like <xen:if page ="forumhome">adcode here</xen> else <adcode> ... so i can use a small banner on the frontpage and the larger banner on all the other pages?
 

Lu Kas

Active member
#4
hi jake, i have one more question, is there a better way to set different ad codes than my actual way? i have a small banner for all the sites with the sidebar and a large banner for all other sites. here is what i produced:

Code:
<xen:if is="{$contentTemplate} == 'forum_list'">
    <div id="werbung">
        <div class="banner">
AD CODE SMALL
          </div>
        </div>

<xen:else />

<xen:if is="{$contentTemplate} == 'dark_taigachat_full'">
    <div id="werbung">
        <div class="banner">
AD CODE SMALL
          </div>
        </div>

<xen:else />

<xen:if is="{$contentTemplate} == 'xentrader_index'">
    <div id="werbung">
        <div class="banner">
AD CODE SMALL
          </div>
        </div>

<xen:else />

<xen:if is="{$contentTemplate} == 'member_list'">
    <div id="werbung">
        <div class="banner">
AD CODE SMALL
          </div>
        </div>

<xen:else />

    <div id="werbung">
        <div class="banner">
AD CODE BIG
          </div>
        </div>

</xen:if>
</xen:if>
</xen:if>
</xen:if>
 

Jake Bunce

XenForo moderator
Staff member
#5
Use this:

Code:
<xen:if is="in_array({$contentTemplate}, array('forum_list','dark_taigachat_full','xentrader_index','member_list'))">
	<div id="werbung">
		<div class="banner">
			AD CODE SMALL
		</div>
	</div>
<xen:else />
	<div id="werbung">
		<div class="banner">
			AD CODE BIG
		</div>
	</div>
</xen:if>