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

XF 1.5 Conditional for media gallery page?

Discussion in 'XenForo Questions and Support' started by CyclingTribe, Jan 29, 2016.

  1. CyclingTribe

    CyclingTribe Well-Known Member

    I've recently changed my adsense code to manually apply banner sizes, and have put a separate conditional in for the home page because the sidebar reduces the available width of the ad-space:
    Code:
    <xen:if is="{$contentTemplate} == 'forum_list'">
       <style>
       .cyc_ad_atf { width: 234px; height: 60px; }
       @media(min-width: 350px) { .cyc_ad_atf { width: 320px; height: 50px; } }
       @media(min-width: 510px) { .cyc_ad_atf { width: 468px; height: 60px; } }
       @media(min-width: 764px) { .cyc_ad_atf { width: 728px; height: 90px; } }
       @media(min-width: 801px) { .cyc_ad_atf { width: 320px; height: 50px; } }
       @media(min-width: 815px) { .cyc_ad_atf { width: 468px; height: 60px; } }
       @media(min-width: 1060px) { .cyc_ad_atf { width: 728px; height: 90px; } }
       @media(min-width: 1315px) { .cyc_ad_atf { width: 970px; height: 90px; } }
       </style>
    <xen:else />
       <style>
       .cyc_ad_atf { width: 234px; height: 60px; }
       @media(min-width: 350px) { .cyc_ad_atf { width: 320px; height: 50px; } }
       @media(min-width: 510px) { .cyc_ad_atf { width: 468px; height: 60px; } }
       @media(min-width: 764px) { .cyc_ad_atf { width: 728px; height: 90px; } }
       @media(min-width: 1020px) { .cyc_ad_atf { width: 970px; height: 90px; } }
       </style>
    </xen:if>
    
    This works fine, however the XF Media Gallery also has a sidebar and now the top banner and sidebar ads are overlapping.

    Is there an additional conditional that I can add for "if this is a gallery page" use these ... widths?

    Cheers,
    Shaun :D
     
  2. CyclingTribe

    CyclingTribe Well-Known Member

    Alternatively, could I use some custom CSS to push the gallery sidebar down 100px or so, so it is out of the way of the top banner?
     
  3. Brogan

    Brogan XenForo Moderator Staff Member

    CyclingTribe likes this.
  4. CyclingTribe

    CyclingTribe Well-Known Member

    Thanks, it turned out there were a few more with sidebars as well, so I took your advice and used a template list conditional: (y)
    Code:
    <xen:if is="in_array({$contentTemplate}, array('forum_list', 'xengallery_media_view', 'xengallery_album_view', 'member_notable', 'online_list', 'resource_view'))">
    Cheers,
    Shaun :D
     
  5. Brogan

    Brogan XenForo Moderator Staff Member

Share This Page