• 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

briansol

Active member
#1
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?
 

Attachments

Chris D

XenForo developer
Staff member
#2
It's not actually your gallery content.

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

upload_2015-1-21_17-6-47.png

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.
 

briansol

Active member
#3
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...

Code:
<div style="text-align: center">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!--  Header Responsive -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-xxxxxx"
data-ad-slot="xxxxx"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>

ad.png



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

Mike

XenForo developer
Staff member
#4
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.
 

briansol

Active member
#5
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:
media/door-chime-location-crx.2558/


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?
 

Mike

XenForo developer
Staff member
#6
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).
 

briansol

Active member
#7
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.