I would like to determine the theme to be used for some specific nodes but let the users choose the default theme for the rest of the site, can it be done ?
I've tried using this module with switchtheme.module but they don't play well together (for authenticated users).
One option I thought about is creating another fake language and use the language property to set the theme but this is not an option since it will create duplicate content, I'm just mentioning it to demonstrate how I want this to work.
Is that doable ?
Thanks.

Comments

tsi’s picture

I might have them working together using this patch http://drupal.org/node/365266#comment-2176912 and giving themekey a lighter weight in the system table.
will report here if there are more issues.

mkalkbrenner’s picture

I recommend that you only use ThemeKey to achieve want you want and uninstall switchtheme to avoid conflicts.

Set a default theme for your site and install ThemeKey UI to assign a theme to some special nodes directly in the node edit form.

tsi’s picture

Thanks but that is not what I'm trying to achieve, switchtheme gives me the possibility to place a block with a selection of some themes (not necessarily all enabled themes) for the user to choose from as a default theme - not node related. then when the user browse to a node with a themekey rule applied to it the theme will change to the themekey theme.
I would love to do it with just themekey but how is that possible ?

mkalkbrenner’s picture

Ok, got it.

Drupal doesn't support well more than one module setting a custom theme. If there's no module that triggers the theme engine in hook_init(), the last module that sets $custom_theme wins.

ThemeKey itself only sets $custom_theme if no other module set $custom_theme before. (I think switchtheme does it like this as well).
Maybe we should add a switch for this behaviour ...

If you're able to write a small module by yourself, it should be easy to implement a theme switching block that uses ThemeKey to the same thing as switchtheme.

Switchtheme stores the selected theme in the session: $_SESSION['custom_theme']. (BTW that doesn't work in combination with caches pages)
ThemeKey has a similar optional feature but uses $_SESSION['themekey_theme']. Maybe we should simply use the same name for the session variable ...

mkalkbrenner’s picture

I added a switch to configure if ThemeKey should override a custom theme set by another module. It will be available with the next release.

tsi’s picture

Thanks for the response.
I'm afraid writing the module will be over my head, more a designer than a developer, but maybe one day...
about #5 - what are the consequences of this "in real life" ? I *do* want themekey to set the theme on specific nodes, just let switchtheme decide what's going on elsewhere - on pages where themekey doesn't have any active rule.

mkalkbrenner’s picture

After the next version of ThemeKey is released turn on "Force custom theme overriding" and set ThemeKey's module weight higher than switchtheme's module weight.

Now switchtheme should work like expexted except when ThemeKey decides to override the theme according to your rules.

mkalkbrenner’s picture

Title: Let user select default theme » Compatibility to Switchtheme (was: Let user select default theme)
Assigned: Unassigned » mkalkbrenner
Category: support » feature
Status: Active » Needs review
mkalkbrenner’s picture

Status: Needs review » Fixed
tsi’s picture

Confirm fixed, Thanks !

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.