Posted by wpanssi on November 10, 2009 at 8:38pm
I'm wondering if there's a way to include different css files based on node or url. With http://drupal.org/project/themekey I am able to change the theme based on various things. However, changing theme constantly will slow down the site and just changing css file would be enough.
I didn't find any modules to do this. Which would be the best way to start working with this kind of task.
Thanks in advance!
Comments
_
I can think of a couple of ways. I usually just add the relevant css, using the necessary node or body selectors (which you can add if you need to), right to the theme. If you really want to load css conditionally, you could use some http://api.drupal.org/api/function/drupal_add_css calls right in the template.php file for your theme. Yet another option might be the http://drupal.org/project/css_injector module.
_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.
Thanks. I guess one solution
Thanks. I guess one solution would be to use page.tpl.php to give url -spesific names to classes and then style them differently via CSS.