Adjusting the viewport for iPad in Blogger (dynamic template) and Apple smart app banners: A tale of two meta tags



A viewport is the area of a webpage that a user will see on screen when visiting a website from a mobile device such as an iPhone or an iPad. Apple's thorough documentation describing it can be found here.

I use the blogger dynamic template for my blog with magazine as my default and on iPad apart from a few scrolling peculiarities it works fine. But the other day I turned the device from my usual landscape orientation into portrait and to my horror found the the right side of the web page was cut off.

In order to fix this I first selected "Template" from the left sidebar in blogger, then chose to "Edit HTML" and ignoring the warning I pressed "Proceed".

I then located this line of code:

<meta content='initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width' name='viewport'/>

and replaced it with this one

<meta content='initial-scale=0.8, maximum-scale=1.0, user-scalable=yes, width=device-width' name='viewport'/>

Now the content sits nicely in the centre even in portrait.

Finally, while I was there I added another line of code directly above the edited one to read

<meta content='app-id=582084676' name='apple-itunes-app'/>

This added an Apple smart banner to my site when viewed in iPad to advertise The Waking Prince for iPad, which I've been discussing in other posts. If you want to learn how to add your own smart banners and even gain some affiliate revenue see here.

Update: Blogger dynamic template now appears to default to classic layout.



Comments

  1. I've just switched to dynamic template from the classic and lots of my visitors are complaining they can't view on iPad or iPod, I don't want to revert back as traffic has doubled through other browsers. Will this fix this issue? Must warn my blog is 18+ and very not suitable for work

    My email is yummyx@hotmail.co.uk if you can assist.

    ReplyDelete
  2. The problem that this post addressed is now largely fixed, but viewing through a web browser is still not perfect on iOS. For the best viewing experience, I'd recommend apps like River of News https://itunes.apple.com/gb/app/river-news-free-for-google/id532887235?mt=8 or Need for Feeds https://itunes.apple.com/gb/app/need-for-feeds/id528949277?mt=8

    River of News is easy to sign into and to see your Google Reader blogs, while Need for Feeds makes finding blogs easy but has more distracting ads. Both are free.

    ReplyDelete

Post a Comment