Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Mobile Site Link for redirection


Reply


2 Posts   676 Views

Avatar
Scott Farmer

Community Member, 42 Posts

4 October 2011 at 10:23am

Hi all,

I've setup a site with the latest version of silverstripe and latest version of the mobile module. Works fine on a Iphone / Android, redirections to mobile domain and uses correct mobile theme.

I wanted to test in a normal desktop browser, so I used ?fullSite=0 to view mobile version and ?fullSite=1 to view normal website. This worked fine on dev site local host, but on test server, with mobile domain redirection setup this causes a loop and you can't get out of the mobile version again.

Any hints here would be appreciated.

Thanks

Regards
Scott

Avatar
Scott Farmer

Community Member, 42 Posts

10 October 2011 at 4:46pm

Edited: 10/10/2011 5:09pm

Update:

It seems to be a issue when you have Mobile site behaviour set to: Mobile users are redirected to mobile domain. Redirects fine to mobile site and displays correct theme. The problem is the fullsite link doesn't work. When you click this it redirects back to fullsite domain, but then redirects back to mobile domain. Works fine if set to " Mobile users see mobile theme, but no redirection occurs". Any ideas?

Solution:

It seems by editing MobileSiteControllerExtension.php, line 71 and adding a check if fullsite cookie has NOT been set, then enable mobile site / theme. It appears to me this function just checks if on mobile site domain, and if true over-rides fullsite cookie.

i.e. if($this->onMobileDomain() || isset($_GET['fullSite'])) {

Thanks

Regards
Scott