Posted by badge on March 3, 2012 at 7:39pm
I've created an omega subtheme, and am trying to add a CSS file only for a specific content type (confusingly called `problem'). I've tried to get to grips with the preprocess-html.inc file (I think this is what I need), but have had no you writing a suitable THEME_preprocess-html function (*trying* to use drupal_add_css).
At the moment I've butchered the html.tpl.php file thus:
<?php if(isset($classes_array[7])) : if($classes_array[7] == 'node-type-problem'): ?>
<style type="text/css" media="all">
@import url("../css/menu.css");
</style>
<?php endif; endif;?>How can I do this correctly? I'm at a complete loss!
Comments
You may try "Context Add
You may try "Context Add Assets" http://drupal.org/project/context_addassets and set a contextual filter for that specific content-type
--
http://jmolivas.com/
@jmolivas
Perfect!
Thanks very much, does exactly what I need!