Copied to clipboard

Flag this post as spam?

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


  • Phil Dye 149 posts 325 karma points
    Jul 21, 2010 @ 16:33
    Phil Dye
    0

    Serve content tree with alternate mobile template

    Can someone help with pointing me in the right direction on how to serve the exact same content tree, but with an alternate set of templates? (Reason: to serve a mobile version of a site)

    I'm ok (I think) with how to detect mobile browsers (either WURFL or MDBF), and to redirect them from a usercontrol that does the detection, but it's then where to redirect them to I'm struggling with.

    Phil

  • Phil Dye 149 posts 325 karma points
    Jul 21, 2010 @ 16:51
    Phil Dye
    0

    (Sorry, replying to my own post...)

    I've so-far worked out that I can use altTemplate in some way, along the lines of http://our.umbraco.org/forum/templating/templates-and-document-types/8588-alttemplate---url-rewriting, but the missing piece is how to maintain that state (ie make the altTemplate sticky), so that all links end up using the altTemplate version of their URLs?

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jul 21, 2010 @ 18:30
    Dirk De Grave
    1

    Hi Phil,

    I'd go with a custom NiceUrl() method (if you're using this from xslt, you could write your own xslt extension), and that custom NiceUrl() could do the mobile check (or you feed this as a param to the function) and let it return the alternate template syntax url

    For example, if NiceUrl() would return /path/page.aspx and you're in mobile mode and want to serve this using alternate templates, you could let it return /path/page/m.aspx

     

    Hope this helps.

    Regards,

    /Dirk

  • Phil Dye 149 posts 325 karma points
    Jul 28, 2010 @ 17:24
    Phil Dye
    0

    Thanks Dirk, I'll try something along those lines, and post back with the outcome...

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies