Hello,

I'm trying to load a .css file into the front page. The name of my file is front_page.css.

I use drupal_add_css(drupal_get_path('module', 'front') .'/front_page.css'); in the text box for an authenticated user, but it seems the page never loads this CSS. Any ideas?

Thanks,
DSC

Comments

Dublin Drupaller’s picture

not sure if this is of use but..
http://drupal.org/node/92875

Dub

DayShallCome’s picture

I can't seem to get it to work, even with the link you gave me. Any idea what to do from this point? Does anyone else use CSS definitions in their front_page?

somes’s picture

I was trying to do the same but the load hook doesnt seem to work ie in the tabs modules to add the css files all you need is

function tabs_load() {
static $loaded = FALSE;
if (!$loaded) {
$path = drupal_get_path('module', 'tabs');
drupal_add_js($path . '/jquery.tabs.js');
drupal_add_js($path . '/tabs.js');
drupal_add_css($path . '/drupal-tabs.css');
drupal_add_css($path . '/tabs.css');
drupal_set_html_head('


');
$loaded = TRUE;
}
}

any ideas Dub how this can be done in the front.module and not in the theme file

beginner’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

http://api.drupal.org/api/5/function/drupal_add_css

drupal_add_css works for me.
Have you php enabled for the front page?
Have you disabled css preprocessing?
Have you checked the page's source to see if the link to the css file is printed?

Phillip Mc’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)