Hi all,
I am working on creating a base theme to build any future work on.
Elements will include bits of:
Zen theme
Hunchbaque theme
Sympal Theme
Blueprint CSS framework.
In order to add the reset.css component of blueprint.css,
I need that stylesheet to get added before drupal adds module css files.
I have a function in my template.php file that I use to add all the css.
function bluezen_styles() {
drupal_add_css(path_to_theme().'/css/lib/typography.css', 'theme', 'all');
drupal_add_css(path_to_theme().'/css/lib/grids.css', 'theme', 'all');
drupal_add_css(path_to_theme().'/css/lib/buttons.css', 'theme', 'all');
drupal_add_css(path_to_theme().'/css/lib/print.css', 'theme', 'print');
drupal_add_css(path_to_theme().'/css/layout.css', 'theme', 'all');
$css = drupal_add_css();
$reset = path_to_theme().'/css/lib/reset.css';
$css[all][module][$reset]= 1;
// array_unshift($css[all][module],($reset=>1));
return drupal_get_css($css);
}
This does a great job of adding all the extra css files.
The tricky thing is getting the reset.css file adding to the beginning of the $css array.
The code displayed above only adds in to the end of the $css[all][module] array.
array_unshift seems to be the correct function, but I can't get that to work.
As a workaround, I have added it in as regular HTML above the
print $styles
in my page.tpl.php.
However, this means it isn't included in the CSS aggregator.
Thanks for any tips,
Regards
Alan
Comments
Hi check out this theme
Hi check out this theme framework, you find your solution
http://www.yaml-fuer-drupal.de/de/download
---
Biladi
http://www.biladi.ma
Right inside your
Right inside your template.php file do a
drupal_add_css('path/to/stylesheet.css', module)outside of any function.template.php gets called very early so it'll be the first to be added. Using the "module" parameter will guarantee it'll sit right on top.