Skip to content

Instantly share code, notes, and snippets.

@micahredding
Created March 5, 2013 18:11
Show Gist options
  • Save micahredding/5092638 to your computer and use it in GitHub Desktop.
Save micahredding/5092638 to your computer and use it in GitHub Desktop.
how to switch jquery versions ONLY for the frontside theme
/* Unset jquery, add back in the upgraded version, compatible with Bootstrap */
/* since this happens at the theme level, Drupal's admin theme can use the old version */
function THEMENAME_js_alter(&$javascript) {
unset($javascript['misc/jquery.js']);
}
function THEMENAME_preprocess_page(&$variables,$hook) {
/* Unset jquery, add back in the upgraded version, compatible with Bootstrap */
/* since this happens at the theme level, Drupal's admin theme can use the old version */
drupal_add_js(drupal_get_path('theme', 'THEMENAME') . '/assets/js/vendor/jquery/1.7/jquery.min.js', array('group' => -200, 'weight' => -100));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment