Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-12-28 07:44:48

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

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

#2 2010-12-29 08:07:47

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

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

#3 2010-12-29 09:58:53

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

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

#4 2010-12-29 13:49:40

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

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

#5 2010-12-29 18:56:46

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

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

#6 2010-12-29 18:58:14

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

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

#7 2010-12-29 19:50:27

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

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

#8 2010-12-29 20:27:46

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: user agent switcher and act_if_mobile

Ok I am still on 4.2 this makes sense then

Offline

#9 2010-12-30 06:39:36

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

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

#10 2010-12-30 06:46:36

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

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

#11 2010-12-30 08:18:03

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

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

#12 2011-01-09 19:32:52

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

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

Board footer

Powered by FluxBB