Created
August 22, 2012 07:27
-
-
Save steffenr/3423412 to your computer and use it in GitHub Desktop.
set jquery version for specific page (Drupal 6)
This file contains hidden or 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
<?php | |
function theme_preprocess_page(&$vars) { | |
$m_obj = menu_get_object(); | |
if ($m_obj->type == 'product_group') { | |
// set jQuery 1.5.1 for slider | |
$path_to_slider = drupal_get_path('module', "slider"); | |
drupal_set_html_head('<script type="text/javascript" src="'. base_path() . path_to_theme() .'/js/libs/jquery-1.5.1.min.js"></script>'); | |
drupal_set_html_head('<script type="text/javascript" src="'. base_path() . $path_to_slider .'/ContentFlow/contentflow.js" load="ML"></script>'); | |
drupal_add_js($path_to_slider ."/contentflow_trigger.js"); | |
drupal_add_css($path_to_slider ."/ContentFlow/contentflow.css"); | |
$vars['head'] = drupal_get_html_head(); | |
// remove standard jquery from drupal scripts array | |
$scripts = drupal_add_js(); | |
unset($scripts['core']['misc/jquery.js']); | |
$vars['scripts'] = drupal_get_js('header', $scripts); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In Drupal 7 you have to use hook_js_alter to achieve the same behaviour - http://drupal.stackexchange.com/questions/28820/how-do-i-update-jquery-to-the-latest-version-i-can-download