Webeks.net - freelance programming
freelance programming - php, Joomla, Zend ...
Home :: Articles :: Programming :: Joomla! :: Remove Mootools in Joomla 1.6

Remove Mootools in Joomla 1.6

Written by Miha

 

Removing Mootools in Joomla 1.6 is still not straightforward, quite the contrary. There is no way to remove all the scripts out of the template unless you want to hack core files. But don't do that! It's bad practise! :)

remove Mootools in Joomla 1.5

  1. //remove mootools
  2. $headerData = $this->getHeadData();
  3. $headerData['scripts'] = array();
  4. $this->setHeadData($headerData);

remove Mootools in Joomla 1.6

In Joomla 1.6 core there is hidden a nasty validation that doesn't allow empty array to be given as a parameter for setHeadData function. This has already been reported as a bug on JoomlaCode. But unfortunately developers don't seem to understand why is the inclusion of JS framework in core problematic - especially public pages.

However setHeadData still works if you input an array with JS files.

  1. //replacing mootools
  2. $headerstuff = $this->getHeadData();
  3. $headerstuff['scripts'] = array('/media/ai/js/jquery-151.js'=>'text/javascript');
  4. $this->setHeadData($headerstuff);

As you see we can't remove mootools but we can replace them with another JS framework (jQuery FTW ;)

If you don't require any JS file to be included you could create a blank .js fle and pass this as parameter.

 

Let me know if you find other ways to get rid of MooTools in Joomla 1.6!


blog comments powered by Disqus