• 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?

CyclingTribe

Well-known member
#1
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
 

Brogan

XenForo moderator
Staff member
#3

CyclingTribe

Well-known member
#4
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