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

Display different advert size on forum home page only?

Discussion in 'XenForo Questions and Support' started by CyclingTribe, Nov 23, 2011.

  1. CyclingTribe

    CyclingTribe Well-Known Member

    I'm currently displaying banner ads to guests across the whole site - but the width is just a big too big on the forum homepage because of the sidebar.

    How would I adjust this code in ad_above_top_breadcrumb to display a different advert for the home page only?:

    Code:
    <xen:hook name="ad_above_top_breadcrumb" />
    <xen:if is="!{$visitor.user_id}">
    <div align="center" style="padding: 20px 0 5px 0; font-size: small; color: #000;">
    <script type="text/javascript">
    Google ad code
    </script>
    </div>
    </xen:if>
    
    Thanks,
    Shaun :D
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    How can I show content on a specific page?
    <xen:if is="{$contentTemplate} == 'xyz'">
    This content will show on the xyz template
    </xen:if>

    http://xenforo.com/community/threads/frequently-asked-questions.5183/#post-182355

    Use it with xen:else to display the alternate code. For example:

    <xen:if is="{$contentTemplate} == 'xyz'">
    This content will show on the xyz template
    <xen:else />
    This content will show elsewhere
    </xen:if>
     
  3. CyclingTribe

    CyclingTribe Well-Known Member

    Thanks - so what would the value of 'xyz' be for displaying something on the forums home page?

    I'm at a loss to figure this one out as I can't find a specific contentTemplate for the forums home ... :rolleyes:
     
  4. Fuhrmann

    Fuhrmann Well-Known Member

    Try forum_list
     
  5. Floris

    Floris Guest

    Fuhrmann likes this.
  6. Brogan

    Brogan XenForo Moderator Staff Member

    How can I find out which template to edit?
    Using your browser, view the page source and look for a line of code near the top of the page which begins
    <div id="content" class="; the class is the name of the template. So for the main forum page, the line of code is:
    <div id="content" class="forum_list">, which makes the template forum_list.

    http://xenforo.com/community/threads/frequently-asked-questions.5183/#post-181112
     
    GeeksChat likes this.
  7. CyclingTribe

    CyclingTribe Well-Known Member

    Thanks guys - I'll give that a go. (y)
     
  8. lazer

    lazer Well-Known Member

    Would there be a way of doing this, to display (say) ads within different nodes? So, say I had an advertiser that wanted to advertise in Node 1 and node 4, is there code to achieve this?
     

Share This Page