This project is read-only.

Detect mobile and switch themes

Topics: Themes
Jan 11, 2010 at 3:14 PM

I've been trying to find info on this here in the discussions but couldn't find anything.

How can I make the blogengine detect if a user/visitor is using a smartphone/iPhone and based on this switch what theme is applied? I would like for the Mobile theme to be displayed if a user is using a mobile device. Or does blogengine already do this and I'm not using it correctly?

When I use my iPhone I see the full theme of the blog. I'd like to only have the mobile theme show. But if I'm on a computer then I'd like the full theme (selected theme) to show.

Jan 11, 2010 at 4:36 PM

In the web.config, add iphone/ipod to the list of mobile devices:

<add key="BlogEngine.MobileDevices" value="(iphone|ipod|nokia|sonyericsson|blackberry|samsung|sec\-|windows ce|motorola|mot\-|up.b|midp\-)" />