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.
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
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
(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?
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
Thanks Dirk, I'll try something along those lines, and post back with the outcome...
is working on a reply...
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.