I'll try to explain what I think I remember. Here's an example from one of my sites:
Code:
$pages = explode(',', '*');
$noMenuPages = explode(',', 'checkout_shipping,checkout_payment,checkout_confirmation,checkout_process,checkout_success');
if (!isset($_GET['jgall_slide'])) {
$loaders[] = array('conditions' => array('pages' => $pages),
'jscript_files' => array('jquery-1.4.4.min.js' => -650,
),
);
$calendarPages = explode(',','index_home,reservations');
$loaders[] = array('conditions' => array('pages' => $calendarPages),
'css_files' => array('datepick.css' => 10000),
'jscript_files' => array('jquery.datepick.min.js' => -630),
);
}
if ($this_is_home_page) {
$loaders[] = array('conditions' => array('pages' => $pages),
'jscript_files' => array('jquery.slides.min.js' => -620,
'slides_init.js' => -610,
),
);
}
if (!isset($_GET['jgall_slide'])) {
$loaders[] = array('conditions' => array('pages' => $pages),
'jscript_files' => array('jquery.tooltip.min.js' => -620,
'jquery.tooltip.init.js' => -610,
)
);
}
What it's doing:
- I've got a couple of jgallery pages and don't want jquery to be loaded if it's in slideshow mode; otherwise the first special jscript file loaded (the lowest negative numbered one) wants to be the jquery main file.
- If it's a page where a reservation calendar is displayed, the datepicker css and jquery are loaded next (on a non-slideshow page).
- There's an image slider only on the home page, so the slides control gets loaded next, then its initialization.
- Finally, on non-slideshow pages, the tooltip control and its initialization are loaded ... in that order.
The CSS files load using a positive increment and a value of 10000 is after all the "standard" files are loaded.