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
Comment #1
Dublin Drupaller commentednot sure if this is of use but..
http://drupal.org/node/92875
Dub
Comment #2
DayShallCome commentedI 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?
Comment #3
somes commentedI 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
Comment #4
beginner commentedhttp://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?
Comment #5
Phillip Mc commented