ThemeKey allows you to define simple or sophisticated theme-switching rules which allow automatic selection of a theme depending on current path, taxonomy terms, language, node-type, and many, many other properties. It can also be easily extended to support additional properties exposed by other modules. In combination with Drupal's theme inheritance you can easily achieve features like:
- individually-styled channels
- a front-page / "splash" screen
- a date/time-selected Christmas theme
- mobile themes for different auto-detected mobile devices
- special themes for "limited" or "old" browsers
- content, user, or role -specific themes
- indicating your environment (production, staging, testing, sandbox, … )
- testing your redesign safely on a live server
And unlike other theme switching modules, ThemeKey should play well with internal and external page caches, like Boost or Varnish, even for anonymous users.
Feedback is welcome!
Damn, ThemeKey ... ROCKS! Really appreciate the kick ass work you did on this :) mortendk
ThemeKey 7.x for Drupal 7
ThemeKey 7.x contains some noteworthy differences compared to ThemeKey 6.x:
- The optional module ThemeKey User Profile replaces the Drupal 6 themes per user core feature, which has been removed from Drupal 7 core.
- The optional module ThemeKey Compatibility solves the generic problem of concurrent theme switching modules by integrating them into it's Theme Switching Rule Chain. Now you can combine features like core's Administration Theme, Organinc Groups Theme and many more using ThemeKey.
- The additional module ThemeKey Properties became part of ThemeKey itself.
What's new in ThemeKey 7.x-3.x?
3.x offers more functionality for mobile devices. It integrates with Browscap and Mobile Detect and contains a new sub-module named ThemeKey Redirect to create an additional rule chain to redirect the user, for example to a simplified mobile version of a site.
The new sub-module ThemeKey CSS offers an additional rule chain to add single CSS files based on rules, instead of or in addition to switching the theme.
All Fields assigned to nodes became ThemeKey properties to create rules based on field values!
A lot of other improvements. Have a look at the CHANGELOG.txt for details.
For developers: More hooks and some reusable components to extend ThemeKey more easily.
ThemeKey 8.x for Drupal 8
ThemeKey 8.x requires a complete re-write due to the heavy changes in core. But the work on it has been started during the code sprints at Drupal Con Amsterdam. The key architectural design decisions are implemented already.
But to be honest, the port / re-write of all the ThemeKey features will take a lot of time. To speed it up we need more developers or some funding to spend more time on it. Feel free to contact us.
Special Module Integrations
Beside the standard features ThemeKey automatically extends it's features if one of these modules gets installed:
- Printer, e-mail and PDF versions
- Views (D7 only. This doesn't mean that ThemeKey 6.x doesn't work with Views 6.x! But the for 7.x there're additional ThemeKey properties available.)
- WURFL (D6 only, WURFL has not been ported to D7 yet)
- Persistent URL (D7 only)
- Organic Groups (D7 only)
- Browscap (D7 only, requires ThemeKey 7.x-3.x)
- Domain Access (partly, D7 only, requires ThemeKey 7.x-3.x, will be moved to Domain ThemeKey soon)
- Fields in core (D7 only, requires ThemeKey 7.x-3.x and Drupal Core >= 7.22)
- Mobile Detect (D7 only, requires ThemeKey 7.x-3.x)
- Mobile Detect API (D7 only, requires ThemeKey 7.x-3.x)
- Workbench Access (D7 only, requires ThemeKey 7.x-3.x)
As mentioned above, in D7 every theme switching module that implements hook_custom_theme() could become part of ThemeKey's rule chain using the included ThemeKey Compatibility module.
Related Projects / Modules extending ThemeKey
- ThemeKey Properties offers additional properties you can choose from to ThemeKey 6.x.
- Taxonomy Theme offers a user interface to trigger selection of different themes based on taxonomy and uses ThemeKey as its back end.
- ThemeKey CiviCRM provides CiviCRM related properties.
- MobileKey - another approach to handle mobile devices beside ThemeKey's internal client detection and the WURFL-Integration.
- Mobile Tools (7.x-3.x will use ThemeKey for the theme switching part)
- Domain ThemeKey integrates Domain Access and ThemeKey
After installing ThemeKey, you'll have access to a lot of documentation using Drupal's built-in help system at
/admin/help/themekey. You will find descriptions of all ThemeKey properties, some examples, and tutorials. The ThemeKey 6.x tutorials are also available at
Just click the "Tutorials" link to open the collapsed overview.
ThemeKey 7.x contains an optional module called ThemeKey Example to demonstrate developers how to extend ThemeKey.
- bio.logis offers a comprehensive spectrum of genetic analyses.
- pgsbox.com - Personal Genomics Services
- JetBrains PHPStorm
Sessions / Slides / Videos
- Video tutorial by Mustardseed
- Sat Sep 17 2011: The ThemeKey at Drupal City Berlin
- Jun 25/26 2011: ThemeKey session at Drupal Design Camp Berlin (site offline)
- Sun Feb 6 2011: ThemeKey session at Drupal Developer Days Brussels
- Sat May 8 2010: ThemeKey session at Drupal Dev Days Munich (site offline)
- Sat Nov 28 2009: ThemeKey session at Drupal Camp, Vienna (German slides).
- Maintenance status: Actively maintained
- Development status: Under active development
- Module categories: Administration, Content Display, Mobile, Organic Groups (OG), Theme Enhancements
- Reported installs: 27,110 sites currently report using this module. View usage statistics.
- Downloads: 299,525
- Automated tests: Enabled
- Last modified: July 6, 2015