Skip to content

Instantly share code, notes, and snippets.

@JPKCom
Forked from input/Usage
Created February 16, 2016 11:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JPKCom/82ceb23e14b1b881ea3c to your computer and use it in GitHub Desktop.
Save JPKCom/82ceb23e14b1b881ea3c 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