Where is it best advised to include JavaScript and CSS files, in the case you have a theme and a sub-theme? Does it have the same effect when you use those files from a .info file, a template file, or a module?
Asked
Active
Viewed 104 times
1 Answers
3
For JavaScript files, the files are being grouped by where they are called from. Below is the order in which they are called.
- Libraries: Libraries, settings, or jQuery plugins
- Modules: Javascript files added by modules
- Themes: Javascript files added by theme (like in
.info
files)
See the description for $options
given in drupal_add_js().
For CSS files, there are three groups too.
- System layer CSS files (e.g. modules/system/system.menus.css and modules/system/system.theme.css)
- CSS files added by modules
- CSS files added by themes
See the description for $options
in drupal_add_css().

Muhammad Reda
- 26,379
- 14
- 93
- 105
-
tanx for the useful info @Muhammad Reda.but i would like to know if there is any difference in action when adding the javascript and css files in .info,.module,template files... – arteta May 19 '13 at 14:14
-
The only difference will be due to the **order of execution**, which is illustrated above. – Muhammad Reda May 20 '13 at 07:54