I'm not sure entirely why, but I was having themekey not work on nodes (node:type), where it did work fine on taxonomy:vid.

After doing some diging and dpming around, I discovered that for the taxonomy:vid, the hook_init was getting called early, and so the global $theme variable was null, so init_theme() would work fine. But for nodes, apparently init_theme() has already run once, so the global $theme was set!

I changed it to work by adding the following to the end of themekey_init():

    $custom_theme = $theme;
    // Need to clear the global theme for init_theme to do anything.
    global $theme;
    $theme = NULL;
    init_theme();

Which caused it to work fine. Ideas? It's a bit of a hack, but otherwise this module looks to do exactly what I need to do.

Comments

jcfiala’s picture

After looking on some of the other posts, I removed the change I made, and instead set the weight of themekey in the system table to -2. This fixed the problem I was having.

profix898’s picture

Status: Active » Fixed

On install the default weight of the module is now set to -10 ...

Status: Fixed » Closed (fixed)

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

TimeBandit’s picture

Status: Closed (fixed) » Active

Upon upgrading to 3.6 I had this same issue. Checked database and system > themekey was set to 0. I set it to -10 and it resolved the issue.

math-hew’s picture

#4 solved this issue for me as well.

mkalkbrenner’s picture