Mobile Theme Selector Plugin
The mobile theme selector plugin is a dynamic plugin which allows a site administrator to select a specific theme that should be displayed to a user who is viewing the page with a mobile device.
Since there are so many people visiting websites from Iphones and other mobile devices, this plugin is very useful in that it can dynamically change the theme of the site to one that accomodates a smaller screen size. The plugin uses the following logic to determine if the user is visiting from a mobile device:
if ((HttpContext.Current.Request.UserAgent.IndexOf("IEMobile") > -1) || (HttpContext.Current.Request.Browser.IsMobileDevice))
If the statement above is true, the plugin will change the theme shown to the end user from the default (selected) theme to the mobile theme named in the plugin settings. In order to work correctly, the Mobile Theme Selector plugin setup requires that a mobile theme is created or installed on the Graffiti installation prior to setup.*
This plugin is a part of the Graffiti Extras project and can be download at http://codeplex.com/GraffitiExtras
*The GraffitiExtras project includes a mobile theme that can be installed through the Graffiti administration panel.
- #1 justastranger on 3.04.2009 at 5:02 AM
-
Does this code include a check if the site is opened on iphone or on windowsmobile with Opera or other mobile browsers?
- #2 ed hardy on 3.09.2010 at 7:37 PM
-
I really appreciate the kind of topics you post here. Thanks for sharing us a great information that is actually helpful.