1. 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

Discussion in 'Styling and Customization Questions' started by Lu Kas, Jun 27, 2011.

  1. Lu Kas

    Lu Kas Active Member

    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?
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Code:
    <xen:if is="{$contentTemplate} == 'forum_list'">
    	AD CODE FOR INDEX PAGE
    <xen:else />
    	AD CODE FOR OTHER PAGES
    </xen:if>
    
     
    Puntocom and Lu Kas like this.
  3. Lu Kas

    Lu Kas Active Member

    wow, thank you i will try this right away

    *edit*

    it works ... thank you
     
  4. Lu Kas

    Lu Kas Active Member

    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>
    
     
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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>
    
     
    Lu Kas and Brogan like this.
  6. Lu Kas

    Lu Kas Active Member

    thank you
     

Share This Page