Mobile site in Drupal using Mobile Tools Module

If you want to create a mobile version of an existing Drupal site, including if multisite installation, the following notes - on using the Mobile Tools module - may help.

It has taken me some time to even get round to using this module. Had tried another module, Mobile Plugin, but this is no longer maintained.

Mobile Tools

Using Mobile Tools seems straightforward - though you should note I don't have fancy mobile sites.

Install the module, then head to settings.

Firstly, and crucially: there are options for URLs for the desktop version of the site - which will be the existing URL; and for the mobile version. Suggestion is to use m.example.com as mobile version of www example.com.

Note: if you want to use m.example.com, which seems wise, you will also need to create a subdomain for this, probably via your webhost.
Then, I've found: if you want to use m.example.com for your default Drupal site, the mobile site will appear just fine.
BUT if you want to have m.example2.com, say, for a multisite setup, you find the mobile site does not exist. Solution: create a m.example2.com folder in the sites directory; this will also need settings.php - which you can obtain by copying the www example2.com settings.php file, maybe then editing a little if you specified the address would be www example2.com, so you specify m.example2.com.

In redirection options, seems a good idea to check the box for automatic redirection.

Theme Switching is also important: seems best to choose to do this based on URL. Plus, of course, need to select a Theme, which you'll have to separately install and enable.

Mobile Themes and Blocks

You can obtain themes that are optimised for mobile use, such as Fusion Mobile or Mobile Garland.

Even with these, it may be that your pages will appear cluttered on a mobile phone. One way of simplifying them is to choose which blocks display for the theme, and maybe shift some down the pages, so the content is easy to find.

Mobile Tools and Caching

If you are caching your site, particularly with the excellent Boost module, you could find that visting the home page takes you to cached version, complete with only links to pages on desktop site. A solution is to tell Boost not to cache the home page.
- more interesting, perhaps: I've noticed that Site Information now includes option to choose the home page for mobile site. So, maybe can create a home page specific page for mobile version of the site, and never mind about Boost/Caching.

Mobile Tools includes a file for caching. To use this, need to open the file to see instructions at the top: these two lines need to be added to settings.php (not commented); info on this is in the mobile_tools_cache.inc file.

  $conf['page_cache_fastpath'] = FALSE;
  $conf['cache_inc'] = './sites/all/modules/mobile_tools/mobile_tools_cache.inc';

Duplicate Content

There could be major issues with duplicate content, arising from pages on www domain.com and m.domain.com.

I thought I might be able to counter this using robots.txt, but for this need a distinct robots.txt for the mobile subdomain (could then disallow all pages); not viable for my setup I think, when my www. and m. sites share robots.txt.

One way I've found for perhaps overcoming this issue is to use Menu Attribues module. I've then added nofollow attribute to navigation menu link to the mobile site (which is added on installing Mobile Tools).

Martin Williams