[development] Switching themes in modules
Earl Miles
merlin at logrus.com
Wed Jun 21 17:22:05 UTC 2006
Nedjo Rogers wrote:
>> @all - the right way to add a custom stylesheet from a module is
>> theme_add_style().
>
>
> TDobes offers convincing arguments that we should instead use
>
> <?php
> // Modules should do:
> drupal_set_html_head(theme('stylesheet_import', base_path() .
> drupal_get_path('module', 'mymodule') .'/mymodule.css'));
> ?>
>
> see http://drupal.org/node/52508#comment-79259
I'm not sure -- someone can check -- but since TDobes wrote that, I think the
output of theme_get_style was reversed. I believe this is the case since at one
point I'd hacked my template.php on a site to do just that because modules using
theme_add_style screwed things up. After an updated, I had to remove that hack;
turned out the module was still using theme_add_style.
More information about the development
mailing list