For some projects, you may want to have a mobile web site that uses different markup and layout from the desktop site - for instance, it may be easier to manage two web sites than to create a responsive layout for your desktop site, or you want to use a mobile web framework like jQuery Mobile or Sensa Touch for mobile users.
Mobile Tools module
The most useful module for building separate desktop and mobile sites for Drupal is Mobile Tools, which has many different features:
- Web Browser detection - is the user on a desktop browser or a mobile browser?
- Mobile domain redirection - route users to the correct domain
- Mobile-only themes - different devices may get different themes
- Mobile site availability - let mobile users on full site know there is a mobile version
- Mobile context - offer different functionality to mobile users
There are a few modules available that have limited scope relative to the Mobile Tools module. Their functionality may match your website’s requirements.
Browser Detection - Browscap module
The Browscap project maintains a list of web browsers on both mobile and desktop devices along with their capabilities. The Browscap Drupal module integrates with the Browscap project to make this web browser data available to other Drupal modules. Three modules which use the Browscap module are Mobile Tools, Switch Theme and Mobile Switch.
Mobile Detection and Caching
Mobile device detection gets more complicated when you are using caching, especially with an external cache such as Varnish.
- Mobile Detection with Varnish and Drupal - interesting discussion written by Morten Fangel of issues faced when returning different HTML content to mobile and desktop browsers with Varnish.
When doing domain switching between a desktop and mobile website, it is usually makes sense to use a separate theme for the mobile website. Here are a few mobile themes available on drupal.org: