[themes] How to include and use jquery plugin in my theme

Massimiliano Marini max.linuxtime at gmail.com
Sun Aug 24 09:04:29 UTC 2008


Hi Nicolas,

> in your template php:
> drupal_add_js(path_to_theme().'/js/plugin.js', 'theme', 'header');
> if you want it for a specific node:
> /**
>  * Add JavaScript
>  */
> if ($nid = 14){
>       drupal_add_js(path_to_theme().'/js/plugin.js', 'theme', 'header');
> }
>
> you need to add your plugin to a folder named js in your theme folder.

It works. Thanks for your great help.

-- 
Massimiliano Marini - http://www.linuxtime.it/massimilianomarini/
"It's easier to invent the future than to predict it." -- Alan Kay


More information about the themes mailing list