Hi there!
If you are using J1.5.x and any version of K2 or if you don't want to have any problems with loading mootools and jquery in frontens you should put this piece of code in your template right after the head tag
<head>
<?php
$document =& JFactory::getDocument();
$regexp = '/mootools.js/';
foreach ($document->_scripts as $key => $value) {
if (preg_match($regexp, $key))
unset($document->_scripts[$key]);
}
?>
<script type="text/javascript" src="<?php echo JURI::base(); ?>media/system/js/mootools.js"></script>
<?php
$regexp = '/jquery/';
$jquery = null;
foreach ($document->_scripts as $key => $value) {
if (preg_match($regexp, $key)) {
$jquery[] = $key;
unset($document->_scripts[$key]);
}
}
foreach ($jquery as $jq_path) { ?>
<script type="text/javascript" src="<?php echo $jq_path; ?>"></script>
<?php } ?>
<script type="text/javascript">
if (typeof jQuery !== 'undefined') jQuery.noConflict();
</script>
<jdoc:include type="head" />
You can download joomla system jquery plugin from extensions.joomla.org (lets say jqueryeasy or scjquery) and intall it setting it to load jquery and jqueryui in both frond and backend.
If you plan to use mootool upgrade plugin (J1.5.x and K2 v2.5.1), make sure it is the first one of system plugins and jquery is second. Disable K2 jquery loading from parameters.
If you have problems with K2 v2.5.1 in rendering or operating in backend, than you should check the scripts in element folder. (I will discribe that in another topic -
here
)