Archive for the ‘Uncategorized’ Category

Disable Mootools in Joomla 1.6

with 24 comments

Disabling Mootools in Joomla 1.5 was actually pretty simple. All you need to to is add the following to your template above your head tag:

getHeadData();
    $headers['scripts'] = array();
    $this->setHeadData($headers);

    // make sure to eliminate any of the following
    //JHTML::_('behavior.framework', true);
    //JHTML::_('behavior.mootools', true);
?>

In Joomla 1.6 this can remain the same if you adjust a tiny bit of Joomla internals. Specifically we need to modify the setHeadData() function in joomla16/libraries/joomla/document/html/html.php (around line 116).

// original version
$this->_scripts = (isset($data['scripts']) && !empty($data['scripts'])) ?
                  $data['scripts'] : $this->_scripts;

// updated version ( !empty() replaced with is_arrray() )
$this->_scripts = (isset($data['scripts']) && is_array($data['scripts'])) ?
                  $data['scripts'] : $this->_scripts;

What this does is allow Joomla to accept an empty value for $headers['scripts'] where it would previously reject it.

Let me know if you have any questions.

Happy coding!