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

XF 1.3 Responsive adsense inside a link forum issue?

Discussion in 'Troubleshooting and Problems' started by PVO_Dave, Apr 10, 2014.

  1. PVO_Dave

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

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

    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.
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    It's due to this:
    upload_2014-4-10_10-38-6.png

    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?
     
  3. PVO_Dave

    PVO_Dave Active Member

    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?
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    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.
     
  5. PVO_Dave

    PVO_Dave Active Member

    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.
     
  6. PVO_Dave

    PVO_Dave Active Member

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

    Brogan XenForo Moderator Staff Member

    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.
     
  8. PVO_Dave

    PVO_Dave Active Member

    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?
     
  9. PVO_Dave

    PVO_Dave Active Member

Share This Page