Mobile site without sub domain

Get help with installation and running PivotX 2.0.x here. Please do not post Extension or Theme related questions here.

Mobile site without sub domain

Postby Colp » Sun Feb 05, 2012 6:13 pm

I wanted to create a mobile version of my site, but when I read the notes on the mobile site extension it said that the optimal method is to have a sub domain http://m.website.com. My host doesn't allow me to do that. Instead I created two identical weblogs, one called 'full' and the other 'mobile', pointing to different templates. I think this is an elegant solution. A link in the footer allows the user to switch between the two and it has worked well.

Unfortunately if the user is reading an article, and they want a mobile or desktop view of that article they lose it, because the link drops back to the homepage of the weblog. I noticed in this forum that this may have been fixed by the mobile site extension, where the article entry is retained, so I had another look.

I've just enabled the extension and pointed the domain name to my [full] website. I can't tell if it detects the browser or not because anything accessing it now simply displays the mobile template for the site, whether it's a desktop or mobile device. This wasn't really how I expected it to work. The extension settings would suggest that it's only activated when a mobile device is detected and then it would use the mobile template. It's using the mobile template regardless. Clearly the domain is an important aspect of this extension. But what is the suboptimal method I could use?

What I want is to detect the browser or user agent, and then load a different weblog, is that possible? Of course I need some way of being able to drop back to the desktop view without redirecting, so I'm guessing some cookie will need to record if it's already been redirected.

In failing that I need a weblog or a template switcher, that will retain the article when it switches.

Any ideas anyone?
Colp
 
Posts: 43
Joined: Thu Nov 17, 2011 12:36 am
Location: Middlesbrough, UK

Re: Mobile site without sub domain

Postby hansfn » Tue Feb 07, 2012 7:33 pm

I've just enabled the extension and pointed the domain name to my [full] website. I can't tell if it detects the browser or not because anything accessing it now simply displays the mobile template for the site, whether it's a desktop or mobile device. This wasn't really how I expected it to work.

No, I wouldn't expect that either. I tested and could reproduce the issue. Apparently the guys writing the extension only tested with a separate sub domain for the mobile site.

I have just released version 0.7 of the extension fixing the bug(s) you discovered - grab it from the extension site. With this version the mobile extension works very well for people who don't use/have a sub domain for the mobile site - I'll start to use it myself.
hansfn
Developer
 
Posts: 3087
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Mobile site without sub domain

Postby Colp » Thu Feb 09, 2012 11:34 pm

Thanks for fixing this Hans. It now does exactly as I expected. I like that the use of the cookie remembers my last setting and that it retains the entry, just as I wanted.

It might be worth noting that at first I had some 404 errors. I thought it was due to the ?mobilecookie and that I was using mod rewrite on the URLs. I disabled mod rewrite and it worked, but then I re-enabled it and it still works. I can't reproduce the problem now, so I'll put it down to a glitch. ;)

Thanks again for the fix and great product.

Colin
http://www.friedhornet.co.uk
Colp
 
Posts: 43
Joined: Thu Nov 17, 2011 12:36 am
Location: Middlesbrough, UK

Re: Mobile site without sub domain

Postby Colp » Thu Feb 09, 2012 11:52 pm

Ah, I wonder if there's still something to fix. I'm using the [[mobilelink to=...]] tag as defined in the doc. It appends &mobilecookie=1 to switch to full view and &mobilecookie=-1 to switch to mobile view.

I just noticed on my iphone that these are appended to the URL each time the option is clicked, so jumping to full view and back again doesn't change the setting from 1 to -1 it actually appends ?mobilecookie=1?mobilecookie=-1. Do this several times and you get ?mobilecookie=1?mobilecookie=-1?mobilecookie=1?mobilecookie=-1.

The URL works so it's not a big problem, but it doesn't look neat. What do you think?

Colin
Colp
 
Posts: 43
Joined: Thu Nov 17, 2011 12:36 am
Location: Middlesbrough, UK

Re: Mobile site without sub domain

Postby hansfn » Fri Feb 10, 2012 10:23 am

I'll fix it - I hate ugly URLs. (Will make a new release tonight.)
hansfn
Developer
 
Posts: 3087
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Mobile site without sub domain

Postby hansfn » Fri Feb 10, 2012 9:11 pm

I just uploaded version 0.7.1 to the extensions site. It should fix all issues with the mobilelink tag.
hansfn
Developer
 
Posts: 3087
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Mobile site without sub domain

Postby Colp » Fri Feb 10, 2012 11:54 pm

That's brilliant, it works perfectly. Thank you so much.
Colp
 
Posts: 43
Joined: Thu Nov 17, 2011 12:36 am
Location: Middlesbrough, UK

Re: Mobile site without sub domain

Postby Colp » Sat Feb 11, 2012 12:07 pm

Sorry Hans, I've found something else. When I search it uses the 'mobile' searchpage template as it should. When I click on one of the used tags in an entry, the 'full' searchpage template is loaded instead. :(

Colin
Colp
 
Posts: 43
Joined: Thu Nov 17, 2011 12:36 am
Location: Middlesbrough, UK

Re: Mobile site without sub domain

Postby hansfn » Sat Feb 11, 2012 10:10 pm

Thanks for the report. I have just uploaded a new version 0.7.2 that fixes that issue. (It was actually an interesting bug - a combination of a core bug, that I had to work-around, and a simple mistake in the extension itself.) Lets hope this is the last one ...
hansfn
Developer
 
Posts: 3087
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Mobile site without sub domain

Postby Colp » Sun Feb 12, 2012 4:38 pm

Hi Hans, thanks for taking the time to keep going with this. Unfortunately, this time it doesn't seem to have fixed it for me. It still it loads the full searchpage whenever I select a tag from either the frontpage or an entrypage, but will use the mobile searchpage when I use the search form.

I've rechecked the extension settings and they're all pointing to the right template files. I've check it to be 0.7.2. I've also cleared the PivotX and Mobile Safari cache just in case and enabled/re-enabled the extension (I don't know if any of this would make a difference), and I still get the same thing.

Is there anything I need to do to 'reset'?
Colp
 
Posts: 43
Joined: Thu Nov 17, 2011 12:36 am
Location: Middlesbrough, UK

Next

Return to 2.x Support Forum

Who is online

Users browsing this forum: No registered users and 1 guest

cron