-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Preprocess variables for html.tpl.php | |
*/ | |
function themename_preprocess_html(&$variables) { | |
drupal_add_library('system', 'ui.slider'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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