I've spent a lot of time thinking about the best way to add a mobile
site to an existing TG 1.5 project.

I'd like to use the same urls for either the full or the mobile
version. Quora does this, and it seems to work well. It's less
confusing when sending links to people, making bookmarks, etc.

Just like Quora at the bottom of each page in the footer will be a
link to the mobile site if on the full site, or a link to the full
site if on the mobile site.

If one clicks one of these links, a cookie is saved for the session
that indicates the users preferred site version.

Now the controllers will use the same code base for each page but
different templates.

So I'd like to be able to indicate the templates like this:

 @expose(template="genshi:foo.templates.bar",
mobile="genshi:foo.moblie_templates.bar")

Now what will happen here is that TG will automatically detect whether
the browser is mobile or not, and render the proper template.  If a
cookie has previously been saved to override this, that template will
be rendered instead.

The footer that sets the cookies seems pretty straight forward.

Any advice on overriding expose to allow for the mobile template to be
explicitly named. And then doing the detection of whether the browser
is mobile or not?

Is there some other way I should be doing this?

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.

Reply via email to