-
-
Save gavinblair/907973 to your computer and use it in GitHub Desktop.
<?php | |
function {theme_name}_preprocess(&$vars, $hook) { | |
if (arg(0) != 'admin' && $hook == "page") { | |
// Get an array of all JavaScripts that have been added | |
$javascript = drupal_add_js(NULL, NULL, 'header'); | |
// Remove the original jQuery library and Drupal's JS include | |
unset($javascript['core']['misc/jquery.js']); | |
unset($javascript['core']['misc/drupal.js']); | |
// Add in our new jQuery library and Drupal's JS include | |
// We do it this way to keep the includes in the same order | |
$core = array( | |
//Alternative jQuery | |
drupal_get_path('theme', '{theme_name}').'/js/libs/jquery-1.5.1.min.js' => array( | |
'cache' => TRUE, | |
'defer' => FALSE, | |
), | |
'misc/drupal.js' => array( | |
'cache' => TRUE, | |
'defer' => FALSE, | |
) | |
); | |
// Merge back into the array of core JavaScripts | |
$javascript['core'] = array_merge($javascript['core'], $core); | |
// Rerender the block of JavaScripts | |
$vars['scripts'] = drupal_get_js(NULL, $javascript); | |
} | |
} | |
?> |
My goal is to have the frontend completely independent of Drupal styles and scripts.
My goal is to have the frontend completely independent of Drupal styles and scripts.
A lofty goal, but there are lots of modules that use javascript on the front end...
Which admin menu are you using?
I was using a module called Administration, but now I'm using a module called Toolbars
wow Toolbar is really bad - switching to SimpleMenu. Working fine so far!
totally using this on http://i.seanja.com so I can use a lightbox plugin to show the images full size
Hmmm... it doesn't really work with compression turned on...
Does it include it? Does it include Drupal's jQuery instead?
I think it might be, I am going to try it out again when I get home to see what it is actually doing.
Adding a second jQuery in another namespace was suggested, but I don't like the thought of loading jQuery twice - it's small but not that small.
I'm not sure, 1.5.1 is what came with the HTML5 Boilerplate.