Closed (fixed)
Project:
ThemeKey
Version:
6.x-2.0-beta7
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
13 Mar 2010 at 01:36 UTC
Updated:
14 Apr 2010 at 14:50 UTC
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
Comment #1
tsi commentedI 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.
Comment #2
mkalkbrennerI 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.
Comment #3
tsi commentedThanks 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 ?
Comment #4
mkalkbrennerOk, 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 ...
Comment #5
mkalkbrennerI added a switch to configure if ThemeKey should override a custom theme set by another module. It will be available with the next release.
Comment #6
tsi commentedThanks 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.
Comment #7
mkalkbrennerAfter 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.
Comment #8
mkalkbrennerComment #9
mkalkbrennerComment #10
tsi commentedConfirm fixed, Thanks !