Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
user agent switcher and act_if_mobile
i don’t see an official support thread for act_if_mobile, but i’m wondering if anyone is able to get this firefox extension to work with the plugin?
Offline
Re: user agent switcher and act_if_mobile
Hi Elliott,
You can switch user agents in Safari without a plugin. I tested the act_if_mobile
on it and it seems that it works as expected.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: user agent switcher and act_if_mobile
thanks yiannis. I have a problem here because the safari user agent switching works fine. for example going to cnn.com shows a mobile site. but when i go to my own site, these user agents aren’t emulating anything. load it up on my iphone and i’m seeing what act_mobile is trying to do.
also does this code look correct?
<txp:act_if_mobile>
<link rel="stylesheet" href="<txp:css name='iphone' />" type="text/css" media="handheld" />
<txp:else/>
<link rel="stylesheet" href="<txp:css />" type="text/css" media="screen" />
</txp:act_if_mobile>
Offline
Re: user agent switcher and act_if_mobile
Your code seems fine and act_if_mobile seems buggy.
as the else
statement is not behaving properly
In the case of a screen user agent the site looks ok but when I chose iphone 4.1 both stylesheets load.
Did you try <txp:else />
, with the space after the e
?
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: user agent switcher and act_if_mobile
ok i seemed to have ironed this out. the bug in the code was
<txp:css name='iphone' />
which should be
<txp:css n='iphone' />
what doesn’t make sense to me is textbook says it should be name=”“
and i did at that space too around the else for insurance.
Last edited by mrtunes (2010-12-29 18:57:05)
Offline
Re: user agent switcher and act_if_mobile
one more thing: i need to figure out how to add a link that says “view full site”. so it somehow has to override what act_if_mobile is doing. does anyone know how i can do this?
Offline
Re: user agent switcher and act_if_mobile
mrtunes wrote:
what doesn’t make sense to me is textbook says it should be name=”“
It is name
. The attribute was changed to name
, and the n
deprecated, in 4.3.0 release. Just as Textbook’s <txp:css /> page states.
Offline
Re: user agent switcher and act_if_mobile
Ok I am still on 4.2 this makes sense then
Offline
Re: user agent switcher and act_if_mobile
Elliott,
Looking at your site and looks fine now when switching user agents but when I go to ipad it still shows the iphone css. Are you working on a solution for that?
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: user agent switcher and act_if_mobile
Hey thanks for checking it out. I was recently wondering about the iPad so it’s good that you brought this up. I am going to guess that the act plugin redirects iPad as a mobile device? If so I will have to adjust because it’s more of a desktop design, right?
Offline
Re: user agent switcher and act_if_mobile
mrtunes wrote:
Hey thanks for checking it out. I was recently wondering about the iPad so it’s good that you brought this up. I am going to guess that the act plugin redirects iPad as a mobile device?
yes
If so I will have to adjust because it’s more of a desktop design, right?
I would think so.
Maybe a liquid layout might be the answer or using min max widths… not sure
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: user agent switcher and act_if_mobile
does anyone know how i can edit the act_if_mobile plugin so that it doesn’t treat the iPad as one of these mobile sites?
Offline