Joomla Mootools Tips and Tricks

Joomla can work seamlessly with Mootools of course. See how you can get started by referring to the guide below.

 


Mootools Tips and Tricks To begin using Mootools in your Joomla! project, start with the right environment: First, use the web browser Firefox (getfirefox.com). Firefox has many plugins and extensions, making development easier. Once Firefox is running, install these extensions: ● Firebug ● Web Developer ● Noscript (Optional) ● FireFTP (Optional) *Note: In order for the extensions to execute, you will have to restart Firefox Now that your debugging tools are setup, you may move on to the actual scripting. One of the best places to learn web programming is W3Schools; they have a tutorial on Javascript, including hundreds of examples. You can find it here. If you'd like a bit more help with Javascript, check out PageTutor's Javascript Tutor. When you're ready to begin implementing Mootools into your Joomla! project, browse the Mootools demos to discover what it is you wish to implement. All that you see at the Mootools site is possible in Joomla! To showcase one possibility, we'll use the Tips plugin of Mootools to create mouseover hints for certain words on the page. Here are the steps: 1) We'll use the Joomla! template editor to add in our script: 1) Login to the administration section. 2) Hover over the Extensions link in the navigation, and select “Template Manager” 3) Mark the template you're using, and click the “Edit” button in the top right corner. 4) On the next page, click the “Edit HTML” button 2) Find the line that contains and paste this code above it: window.addEvent( ”domready” , function( ){ var abbrTools = new Tips( $$( ”abbr” ) ); }); 3) Now, write an article on whatever your mind can think up; be it your mom, your house, or a piece of lint in your sock. 4) Switch to HTML view by pressing the button. Find a word or phrase in your article that you want to point out. Around it, wrap tags, like so: something interesting In the tag, put a title attribute in it, which will serve as the body of your ToolTip: something interesting 5) Post the article and hover your mouse over the words you selected. Voilá! How does it work? (This is a bit more advanced than copying and pasting, so only read on if you feel very comfortable with Javascript) Well, the script you added into the template waits until the page is ready for modification ('domready'). When that happens, it creates a new Tips object. We supply that Tips object with all the tags in the page. Then, Mootools does all the work. After creating the ToolTips and hiding them from the user, it watches all those tags, waiting for the user to hover their mouse over one of them. If the user's mouse happens to move over a tag, Mootools makes the ToolTip visible to the user. Because the ToolTip is just another HTML element, it is possible to put anything into the ToolTip...images, Flash animations, or more HTML tags!