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

Content not sized to viewport

Discussion in 'Media Gallery Support' started by briansol, Jan 21, 2015.

  1. briansol

    briansol Active Member

    Since installing the media gallery (pre xf ownership), I've had my webmaster tools warning report ramp up about content not sized to viewport. I've upgraded to latest versions last week and nothing has changed.

    Given that images are images, what's the best way to solve this? auto scale?

    Attached Files:

  2. Chris D

    Chris D XenForo Developer Staff Member

    It's not actually your gallery content.

    It's your ads. Here's a screenshot:


    Try implementing some sort of responsive ad units. For support with that, consult your ad provider or search XF.com as there are guides on implementing responsive ads through various providers.
  3. briansol

    briansol Active Member

    Interesting... as I am using google's responsive ad units in the global header ad template, and it DOES respond on the main forum areas like this and the media area for me...

    <div style="text-align: center">
    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <!--  Header Responsive -->
    <ins class="adsbygoogle"
    (adsbygoogle = window.adsbygoogle || []).push({});


    G ads won't refresh/rebuild onResize, so scale down then F5 and you should see it that was as well.
    Last edited: Jan 21, 2015
  4. Mike

    Mike XenForo Developer Staff Member

    It responds for me as well (have to have the window shrunk first; it doesn't tend to show an ad at the top when it's very small).

    I would note that at the smallest my Chrome window is going, the ad in the sidebar causes it to slightly overflow. Otherwise, I'm not seeing any overflow issues when browsing.
  5. briansol

    briansol Active Member

    When i have my chrome shrunk down as far as it will go, i don't get any ads at all in the side bar.

    To note, no reports of the media index are showing up, it's actual image pages.

    ie, try:

    Since the homepage doesn't show the sidebar on small screens, but the media gallery does, i think that may be the issue with the ad unit in the sidebar.

    Can we turn off or otherwise make the sidebar more responsive for super small devices?

    any suggestions for a @media query for the ad unit block?
  6. Mike

    Mike XenForo Developer Staff Member

    I don't think a media query to hide the ad unit is the way to go, as you'd still be serving the ad but not displaying it. You may need to adjust the JS code to not serve that ad below a specific width (as in, don't insert the standard div/ad code in that case).
  7. briansol

    briansol Active Member

    Good point.

    I've dropped that ad unit, as it doesn't perform anyway. Ill monitor and see what comes out in the next couple weeks.

    Thanks for he extra eyes.

Share This Page