i hope i am posting my thread in the right place. i want to use drupal_add_css() for a custom module, and i want to know how to use it. i have seen the previous posts regarding drupal_add_css but i cant understand any of them.
i have created a simple foo.css file in my foo module directory which is:
body {
background-color: blue;
}
i want this file to be linked with my module. i have also created a file foo.tpl.php, where i think i have to write a code for linking the css file with my module. what i have to write to do it?
and guys you may help also me with drupal_add_js usage. the implementation is same, i want an external js file linked with my module. but friends give priority to the cs part.
i hope everything is clear :)
Comments
Here you go --
Here you go -- http://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_a... -- I'm sure you must have found the link but I'm not sure if you noticed a "42 functions call drupal_add_css()" and if you expand that there are a list of functions that call drupal_add_css which will give you an example of how to use it, for e.g. http://api.drupal.org/api/drupal/modules%21system%21system.module/functi...
Typical usage:
drupal_add_css(drupal_get_path('module', 'foo') .'/foo.css');
You can write the above line of code anywhere in your enabled module. Sames goes with drupal_add_js
Mukesh Agarwal
www.innoraft.com