Closed (duplicate)
Project:
Context
Version:
6.x-2.0-beta7
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
18 Sep 2009 at 03:01 UTC
Updated:
9 Feb 2010 at 07:29 UTC
I have a contrib module which provides the abillity to swtich the theme based on a context. However, I can't seem to get the theme to be set outside of an init() hook. See the issue in the project queue here:
http://drupal.org/node/559410#comment-2055478
Does anyone know if its possible to set the drupal theme during a hook_context_page_reaction() hook (context_theme_context_page_reaction() in this case)
Is this possible?
Note that this method is very poorly documented right now, and isn't listed at http://drupalcontrib.org/api/search/6/context?
Comments
Comment #1
tronathan commentedUser Asiby sent me the following:
But we need to be able to set the variable during hook_context_page_reaction() - So this approach won't work.
How can we set the theme during hook_context_page_reaction()? (How are these sorts of chicken-egg bootstrap situations usually worked around in drupal?)
Comment #2
pasqualleThe theme change can't be a reaction, because at reaction state it is too late to change the theme. It must be done in hook_init().
So you can't use some of the special context conditions, but you can use quite many. see http://drupal.org/project/themekey
Comment #3
pasqualle#371107: Theme Switcher
Comment #4
socialnicheguru commentedintegration with themekey just as a suggestion
http://drupal.org/project/themekey
Comment #5
yhahn commentedSee #371107: Theme Switcher