Saturday, 04 April 2009 11:32

When working on a template, sometimes you want to use Mootools to do some nifty effects. For example, here on my site I have Mootools doing some hover animations on the left navigation. This works well on content pages, but some pages don't load Mootools by default, like the search results page. To get Mootools to load no matter what page is showing, add this tag to the <head> section of the template, right after the jdoc header include:

<?php JHTML::_('behavior.mootools'); ?>

This method is preferred over statically adding a <script> tag, because if Mootools is already being added as part of the jdoc header include, it doesn't re-add the tag in your html source.

Last Updated on Wednesday, 22 April 2009 21:52
 
Comments (4)
1 Monday, 23 August 2010 19:37
hkn
exactly what I was looking for... thanks!
2 Saturday, 25 September 2010 06:07
M. Mano
Very useful
3 Tuesday, 22 March 2011 01:09
squivo
Thank you! I knew there was an easy way to do this and you saved me quite a bit of heartbeats
4 Tuesday, 26 June 2012 21:57
Raphael Bruno
Thanks, it was what i looking for

Add your comment

Your name:
Comment:
  The word for verification. Lowercase letters only with no spaces.
Word verification:

The Joomla!® name is used under a limited license from Open Source Matters in the United States and other countries. Jeff Channell is not affiliated with or endorsed by Open Source Matters or the Joomla!® Project.

Santorum
Joomla Extensions