Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Richard 1 post 21 karma points
    Jun 18, 2013 @ 23:57
    Richard
    0

    "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

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Jun 19, 2013 @ 12:36
    Jeroen Breuer
    0

    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

  • Josiah D Thoen 18 posts 63 karma points
    Jun 24, 2013 @ 04:28
    Josiah D Thoen
    0

    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.

Please Sign in or register to post replies

Write your reply to:

Draft