I have a desktop site which I have created a mobile version of using the alttemplate feature in Umbraco which allows me to send mobile users to the mobile templates of the site and Desktop computers are provided the original Desktop Version.
I would like visitors of the site to have the ability from there mobile device to select which template they would like to view either mobile or desktop (via link in footer).
Essentially a link which would enable the mobile visitor the option to view in Desktop template version and vice versa.
Currently my research suggest that this would create a loop as the alttemplate will recognize the mobile device then just send the mobile users to the mobile template and likewise for the original desktop version.
Thanks in advance, as I am sure since I am not the only person taking advantage of the alttemplate feature a resolution/option for this may be benificial to a great deal of people other than just myself.
How are you detecting the mobile devices? I believe the only loop that would be created would be one that you create yourself so you have full control to exit the loop. Perhaps an explicit alttemplate would never change the template. An empty or no alttemplate would be desktop an alt of mobile would always be mobile and the alt desktop would always be desktop. The first visit from a mobile device would not have the alt template therefore you would redirect them by setting the alttemplate. If they change the template then it would be set to desktop and your logic should not change it because it was explicitly set.
"Desktop | Mobile" Template option
I have a desktop site which I have created a mobile version of using the alttemplate feature in Umbraco which allows me to send mobile users to the mobile templates of the site and Desktop computers are provided the original Desktop Version.
I would like visitors of the site to have the ability from there mobile device to select which template they would like to view either mobile or desktop (via link in footer).
Essentially a link which would enable the mobile visitor the option to view in Desktop template version and vice versa.
Currently my research suggest that this would create a loop as the alttemplate will recognize the mobile device then just send the mobile users to the mobile template and likewise for the original desktop version.
Thanks in advance, as I am sure since I am not the only person taking advantage of the alttemplate feature a resolution/option for this may be benificial to a great deal of people other than just myself.
Thank you,
Richard
Perhaps you could do something simple like setting a session? If the session is set it won't redirect so the loop is prevented.
Jeroen
How are you detecting the mobile devices? I believe the only loop that would be created would be one that you create yourself so you have full control to exit the loop. Perhaps an explicit alttemplate would never change the template. An empty or no alttemplate would be desktop an alt of mobile would always be mobile and the alt desktop would always be desktop. The first visit from a mobile device would not have the alt template therefore you would redirect them by setting the alttemplate. If they change the template then it would be set to desktop and your logic should not change it because it was explicitly set.
is working on a reply...