Hi,

I have set up ThemeKey to use my mobile theme when a mobile browser is detected. I am also using the module "SwitchTheme" that adds a dropdown on my site to allow users to switch between the mobile theme and the full site.

After getting ThemeKey to display my mobile theme automatically, I cannot switch to my "desktop" theme from the same browser, because it is still detecting that I am on a mobile device.

Is there any way around this? Other sites can detect your browser, but still provide the option to view the full site, if needed.... but I can't figure out how to make it work for my site.

Any insight is appreciated. Thanks

Comments

kyleheney created an issue.

mkalkbrenner’s picture

You have to enable ThemeKey Redirect. This sub-module contains all you need.
BTW if you want to keep SwitchTheme in combination wit ThemeKey you should integrate it using ThemeKey Compat.

kyleheney’s picture

Thanks for the tip about ThemeKey Compatibility. I've done that.

I don't understand why ThemeKey Redirect is necessary... I don't have a subdomain... do you need one for this to work as I want it to? Is adding SwitchTheme to the Compatibility side of things enough?

Thanks

kyleheney’s picture

Okay I think I have figured out how to make it work for my situation. Posting my solution if it will help others in similar situations...

1 - set mobile theme as Default theme
2 - ThemeKey Settings: Compatibility ---> Modules ----> SwitchTheme (checked off)
3 - ThemeKey Switching Chain:

a) mobile_detect:isMobile = true
sub a) themekey_compat:module_switchtheme_triggers_theme = Triggered

b) mobile_detect:isMobile = false ----> Desktop theme

In doing this, SwitchTheme defaults to the Mobile theme first, but if a desktop tries to access the site, then ThemeKey forces the desktop theme to run.

I did not add anything "Redirecting Rule Chain" of ThemeKey as I do not use a subdomain.