Community Documentation

Mobile-specific website

Last updated April 11, 2013. Created by JohnAlbin on December 29, 2011.
Edited by SarahShealy, quiptime, jefflinwood. Log in to edit this page.

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 themes

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:

Page status

No known problems

Log in to edit this page

About this page

Audience
Designers/themers, Programmers, Site administrators
Keywords
browser detection, guide, mobile only, mobile theme
Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.