[development] theme switching based on device & page cache
devendra.in at gmail.com
Mon Dec 26 07:23:24 UTC 2011
I am creating Desktop & Mobile site using Drupal 7. I have same domain +
URL for desktop & mobile site. I am using Browscap for device deteciton and
based on device i am switching theme using hook_custom_theme. This creates
problem if i enable page cache.
Note from Readme.txt file of mobile tools module says
Device detection and redirection works fine when caching is enabled.
However if you choose to do theme switching based on device, caching will
bypass the theme switching and get your pages out of cache:
e.g.: First user visits the site with his iphone and gets the iphone theme.
The theme get's stored in cache, but the second user with a simple feature
phone will also get the iphone theme.
Solution: Open the mobile_tools_cache.inc file and read the documentation!
Documentation from mobile_tools_cache.inc file says
* @file mobile_tools_cache.inc
* This files allow to override the default drupal cache in order to
support theme switching based
* on device type and device group.
* In order to enable this file, add the following to your settings.php
* $conf['page_cache_fastpath'] = FALSE,
* $conf['cache_inc'] =
This doesn't work. Even the syntax is incorrect. Its like
$conf['page_cache_fastpath'] = FALSE, $conf['cache_inc'] =
Really appreciate any kind of help.
Thanks in advance
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the development