Drupal Mobile: How to create a Drupal mobile site without using Mobile Tools

Posted by JD Collier on August 18, 2011

Last year, we talked about using the Mobile Tools module to create mobile sites in Drupal.  We use and appreciate Mobile Tools, but we recently had a requirement that made us look into other options. We needed one domain to serve two different mobile sites. Mobile Tools works well with one mobile site, but we didn't see a way to serve two mobile themes.

For this client, we were already using ThemeKey and we knew the ThemeKey module can test for mobile devices. Out-of-the-box, ThemeKey tests by platform. We didn't want a rule for every device targeted, we needed an easier way to target mobile browsers.  We added MobileKey to the mix and now we can test for desktop, mobile or a specific platform.

Note: We also could have paired Wurfl with ThemeKey to test for mobile browsers, but we don't have sufficient access to this particular server to add Wurfl's requirements (Pear::Log library).

Mobilizing, at a glance with ThemeKey

  1. Install ThemeKey
  2. Install MobileKey
  3. Install mobile theme (We are using Fusion Mobile)
  4. Configure theme switching (see example below)
  5. Style mobile theme to appropriate design

Here are a few thoughts when using ThemeKey:

  • ThemeKey doesn't handle domain redirection, if you need that.
  • We noticed a need to add the code to remove the address bar in the mobile browser.
  • You will need to test for desktop and mobile separately. In my screenprint of the rules, you will see that I've used !(not) desktop, this is only for development. I'll switch to test for mobile.


You can see from one of my older posts, that I have recently returned to Drupal after several years away ... I am not an expert. What do you think about my approach? Would you do anything differently? I'd love your input.

Related posts


photo by ciccioetneo


Get thought-provoking and actionable insights to improve how your firm makes a connection with your customers.


The content of this field is kept private and will not be shown publicly.

Plain text

  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
Submitted by lolandese on Sun, 08/21/2011 - 6:18am

Thanks for sharing.

Submitted by Kim Pepper on Sun, 08/21/2011 - 8:07pm

Nice write up!

How would you handle page caching using varnish etc. if its based on the user agent string?


Submitted by Going mobile: … on Fri, 09/30/2011 - 5:08pm

[...] Digett: Drupal Mobile: How to create a Drupal mobile site without using Mobile Tools [...]