Question

Im creating a custom template for joomla 2.5 and I want to know if is it safe to disable mootools for my template?

If its safe, how can I disable mootools?

Was it helpful?

Solution

You can find several extensions that disable MooTools in the Core Enhancements/Performance section of the Joomla! Extension Directory (JED) As mentioned already it is safe to do it as MooTools is only really required for the Joomla! 2.5.x backend i.e. /administrator.

Having said that you should be aware that some aspects of Joomla! 2.5 front-end do require MooTools to be loaded and many extensions "expect" it to be there (although they are not particularly good ones).

Generally Mootools is loaded by a PHP call of the form JHTML::_('behavior.mootools'); or JHTML::_('behavior.framework')

Core elements that load MooTools in the front-end include:

  1. Contacts (com_contact)
  2. Content (com_content in the blog, category views)
  3. Advanced Search (com_finder)
  4. Newsfeeds (com_newsfeeds)
  5. Weblinks (com_weblinks)

Popular third party components that use it in the front-end include:
1. RokGallery — infact a lot of their stuff prior to RokSprocket
2. Akeeba Subscriptions
3. Akeeba Release System
4. and many others...

The thing to remember is MooTools has been in the 'core' for a long time and developers expect it to be there, rightly or not, so, you will have to check any extensions and see if any core components are impacted adversely when you do remove it.

OTHER TIPS

To add to cppl answer:

As far as I know, every library in Joomla is/should loaded only when it's required. If MooTools loaded on your site, some extension/ core functionality is using it so if you just remove it, some things may break.

What you can do:

  1. Inspect the code that's using MooTools
  2. If it's inline code, probably you may overwrite it using template overwrites to use jQuery
  3. If there's a library (like validate.js) you can provide alternative libraries (utilizing jQuery), put these in /templates/[your_template/js/system/ folder.

Removing MooTools and loading jQuery would make perfect sense than.

Judging by the number of extensions that do this, I'd say it's not only safe, but often desirable.

http://extensions.joomla.org/extensions/core-enhancements/performance/mootools

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top