Skip to content

Instantly share code, notes, and snippets.

@input
Created January 11, 2012 20:01
Show Gist options
  • Save input/1596483 to your computer and use it in GitHub Desktop.
Save input/1596483 to your computer and use it in GitHub Desktop.
Add a jQuery UI library to a Drupal 7 site via template.php
/**
* Preprocess variables for html.tpl.php
*/
function themename_preprocess_html(&$variables) {
drupal_add_library('system', 'ui.slider');
}
Usage
-----
Place the 'themename_preprocess_html()' function in your theme's template.php file.
Rename 'themename' to your theme's actual name,
e.g. for 'bartik' the function name would be changed to 'bartik_preprocess_html'.
Change 'ui.slider' to whichever jQuery UI library you want to add.
In Drupal 7, jQuery UI library files are stored in '/misc/ui'.
See: http://api.drupal.org/api/drupal/includes--common.inc/function/drupal_add_library/7 for reference.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment