XF 1.3 Responsive adsense inside a link forum issue?

PVO_Dave

Active member
Bit of an odd one, I decided to put my header advert within a link forum, as the untidy look of the banners under the breadcrumb was annoying me.

I used the responsive code example from Brogan's thread, which used to work fine as both a header and a footer.

Code:
<center>
<script type="text/javascript">
google_ad_client = "XXXXXXXXXX";
width = document.documentElement.clientWidth;
/* Test - iPhone front page */
google_ad_slot = "XXXXXXXXXX";
google_ad_width = 180;
google_ad_height = 150;
        if (width > 483) {
        /* VxON Smaller Header */
        google_ad_slot = "XXXXXXXXXX";
        google_ad_width = 468;
        google_ad_height = 60;
        }
            if (width > 743) {
            /* Top of the forum (970) */
            google_ad_slot = "XXXXXXXXXX";
                        google_ad_width = 970;
                        google_ad_height = 90;
            }
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></center>

The full size banner works perfectly, the middle one (on an iPad for example) also works great,

E.g.
working banner.webp

but when you scale down to smart phone size, this happens:
too small banner.webp

I can see it's part of the responsive design, as at the same point, the latest thread info disappears etc.. but is there anything I can do about it?

Thanks,
Dave.
 
It's due to this:
upload_2014-4-10_10-38-6.webp

You will need to override that behaviour.

Rather than add it to a link forum, why not just style the advert to match, using the category strip code?
 
Thanks Brogan,

2 options I guess then;
Could I override that behaviour just for link nodes or could I perhaps style the category strip code just for link nodes and put the adverts in there?
 
You can do either one, it's up to you.

Personally I would just add the styling to the advert, rather than try to override the default behaviour.
 
Could you give me some pointers on how to override the behaviour just for link nodes? I can experiment with both then :)

Thanks for your help so far Brogan.
 
Hi @Brogan

I've been experimenting with putting the adverts into categories, but the responsive element is still an issue, as by default it hides the description when getting to mobile sizes.

Can this be bypassed per node do you think?

Dave.
 
I think you should change your approach and style your advert how you want it rather than trying to override the default behaviour.

If there isn't an ad_* template where you want to place it, just create your own custom template and add it either by manually editing the template or via a template modification.
 
I'd rather do that too, but I can't find anything around how you would do something like that, I.e. an advert slot between Nodes 1 and 2 on the forum list?
 
Back
Top Bottom