hi

i must add a CSS file inside the page-*.tpl.php pages. this following isn't working.

drupal_add_css( (path_to_theme() . '/css/layout_test.css'), 'theme', 'all');

the old way

print theme('stylesheet_import', base_path() . path_to_theme() . '/css/layout_test.css');

worked well...

Regards
Alex

Comments

z.stolar’s picture

What does function_exists('drupal_add_css') give you?

hass’s picture

i found out it is added to the array, but the $styles variable isn't updated...

kkaefer’s picture

Just use

or to include the stylesheet in your theme. There is no need to use other functions because you are in your theme anyway.
hass’s picture

no, this is not possible. i must order my styles befor style.css, but after modules. this cannot be done with a include or by manual adding code to page.tpl.php for e.g. after/befor $styles.

It looks like i need to add a theme('styles',... ) function to the theme and add the 'theme' style as type 'module' this way. this one is a bad workaround... but the drupal developers made us to do so until they add a "weight" feature.

creazion_dev’s picture

Take a look at this comment http://drupal.org/node/64292#comment-170649. This should help you.

---------------------------------------------
last projects: www.happyfaces-kinderschminken.de - www.3p-consulting.com

morganl’s picture

In Drupal 5.x, if you want to add css from your page.tpl.php in the manner showen above:

In your "page.tpl.php" file, change the line that currently reads print drupal_get_css($css); to print drupal_get_css();. That's it. problem solved.