[development] Switching themes in modules

Olav Schettler olav.schettler at contaire.de
Tue Jun 20 06:14:23 UTC 2006


I have written a smallish module (http://drupal.org/project/manage) to 
provide a separate theme for administration pages. It works nicely by 
setting $custom_theme and providing some settings for a custom menu and 
selecting on which pages to apply the theme switch.

I learned how to do all this by looking at the blocks.module.
This is also the catch. It doesn't work nicely with blocks.module 
because selecting the current theme is really done through a set of 
global variables ($theme, $custom_theme). Once one module has overridden 
$custom_theme, the knowledge about the original theme (user-specific or 
standard) is lost.

I currently solve this by excluding admin/block pages from the theme 
replacement. I have considered to introduce some kind of stack of 
overridden themes, but as this would affect at least system.module, 
blocks.module, theme.inc so I wanted to discuss this here first.

Is anybody working on this theme selection right now?
This might fall into the realm of Adrian's overhaul of the theming system.

Cheers,
Olav

-- 
Dr. Olav Schettler
(Geschäftsführer)
contAire GmbH
___________________________________________
Arndtstr. 12 | D-50676 Köln | Germany
Office: +49 221 4204757 | Mobile: +49 175 2249141
olav.s at contaire.de | Yahoo! olav
___________________________________________
Please visit our website http://www.contaire.de/



More information about the development mailing list