By wpanssi on
I would like to create a simple custom module which could use $custom_theme to override current theme. In drupal 5 I would have made a custom module and put something like this into custom_module_menu:
>
f($may_cache){
} else{
$custom_theme='some theme';
}
How would I do this in Drupal 6? What hook should I use? (there could be modules for this but I just want to keep it as simple as possible).
Tnks!
Comments
I tried the menu
I tried the menu -hook:
But this doesn't do anything..
--
http://www.sitemedia.fi
Clearing cache won't help,
Clearing cache won't help, neither does adding the call of init_theme() after defining custom_theme..
According to Drupal 6 API $custom_theme exists.. So ANY ideas? Has somebody used $custom_theme succesfully to override a theme?
--
http://www.sitemedia.fi
Are you using simplemenu?
Try disabling simplemenu... they see if $custom_theme works.
Switching theme in drupal 6
How to switch theme depending on user role:
Create a custom module and copy & paste the following:
You have to replace:
mymodule => with your module name
my special role => with the name of the role that your users will need to have in order for them to see a different theme.
mytheme => with the name of the theme that you want to switch to