Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
[howto] Alternative iPhone Specific Site using different template
I finally figured out how to create a specific iPhone specific website using the same TXP install, I wrote about it on my blog
<?php
if (ereg('iPhone',$_SERVER['HTTP_USER_AGENT'])) {
$iphone = 1;
}
elseif (ereg('iPod',$_SERVER['HTTP_USER_AGENT'])) {
$iphone = 1;
}
else {
$iphone = 0;
}
?>
<?php if ($iphone == '1'): ?>
<![if !IE]>
<txp:output_form form="iphone-head" />
<meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
<link rel="stylesheet" type="text/css" href="iphone.css" media="only screen and (max-device-width: 480px)"
charset="utf-8" />
<txp:output_form form="iphone" />
<![endif]>
<!-- If it's NOT an iPhone, show the normal CSS and no Viewport Meta tag -->
<?php else: ?>
<txp:output_form form="head" />
<txp:output_form form="browser" />
<?php endif; ?>
Offline
#2 2010-06-09 17:28:45
- Vide-Dressing
- Member
- Registered: 2010-06-07
- Posts: 31
Re: [howto] Alternative iPhone Specific Site using different template
This is very interesting, i assume that you place this code in the top of your templates files.
But what do you use in <txp:output_form form=“iphone” /> ?
This Howto is very interesting for most of us, if any one could complete it with more details it will be great !
Offline
Re: [howto] Alternative iPhone Specific Site using different template
Vide-Dressing wrote:
This Howto is very interesting for most of us, if any one could complete it with more details it will be great !
Check out the tutorial on TXP Tips.
Offline
#4 2010-07-27 05:39:03
- feliciapage
- New Member
- Registered: 2010-07-27
- Posts: 1
Re: [howto] Alternative iPhone Specific Site using different template
It looks like my research across the net has paid off, I shall have go with this. Thanks
Last edited by feliciapage (2010-07-27 05:44:25)
Offline