As iPhones become more and more popular client of the Interweb, more and
more of our clients are looking to have content specifically
rendered for the iPhone version of Safari.
Now, thanks to Tim Geyssens
(who has done a tonne of nice work for Umbraco) this is very easy to
achieve for our Umbraco clients.
Tim has created an iPhone
template package that was easy to install (it comes as an
installable Umbraco package) and use. The only tweaking I needed to
do was to change some JavaScript for situations when the Umbraco
install is using
directory paths instead of file / .aspx paths. Here is what I
changed:
<script language=javascript>
if((navigator.userAgent.match(/iPhone/i))||(navigator.userAgent.match(/iPod/i)))
{
var suffix = "/iphone";
var startPos = location.href.length - suffix.length;
if (location.href.lastIndexOf(suffix , startPos) !=
startPos)
{
document.location.href=location.href + "/iphone";
}
}
</script>
As you can see, only a small tweak of JavaScript for the master
template and its working a treat :) Nice work Tim!