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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

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

Mobile Site Link for redirection


Go to End


3 Posts   1583 Views

Avatar
Scott Farmer

Community Member, 49 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, 49 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

Avatar
helenclarko

Community Member, 166 Posts

9 December 2014 at 1:27pm

Can you attach some of your code?
I cant seem to find which line you adjusted.