MooAccordion show/hide (in articles) Joomla plugin
MooAccordion makes it easy to add MooTools accordion slides (show/hide blocks) to any article, which can be used to organize and display content more effectively (like in a FAQ page). The syntax is simple:
{mooblock=Trigger Title (used to trigger the slide)}
Content of the slide block...
{/mooblock}
Each part of the mooblock should be on a separate line. Here’s how you can create a new accordion (and insure that it produces valid markup):
- first type
{mooblock=First block title}
, then press enter/return, - then add your content (which can be anything), then enter/return,
- then type
{/mooblock}
, then enter/return. - If you want any other blocks as a part of that accordion, you should then type in
{mooblock=Second block title}
, then enter/return, then the content, and continue in that manner.
Features include:
- adds minimal markup (and intelligently strips unnecessary markup added by editors like tinyMCE and JCE, if present) to keep the html clean and valid
- uses Joomla core MooTools library, which means this plugin adds no HTTP requests, minimizes dependencies, prevents JS conflicts, and is very lightweight
- adds CSS class for active block title, allowing you to toggle it’s icon (e.g., from a + to a - icon); more generally, the markup is fully CSS customizable
- easy for anyone to use (without technical knowledge) and flexible
- the show/hide effects and other settings are easily customizable from the plugin‘s configuration
- compatible with Internet Explorer 6+, Firefox, Chrome, Safari, Opera, etc.
The plugin is similar to JoomlaWork’s Tabs & Slides (in content items) Plugin, the plugin I originally used before being inspired to write this one. My biggest problem with the JW plugin was that when I added the plugin syntax into an article, the plugin would create invalid markup from it, because the WYSIWIG editor automatically wrapped it in a <p>
` tag. Also, it seemed foolish to use an old accordion script rather than the built-in accordion plugin that Joomla already comes with. This plugin solves those issues, and does so efficiently and robustly.
Note: the title can contain html if desired. If it is wrapped by one html element, that element will be used as the title toggler. Otherwise, it will wrap the title in a <h4>
tag. Also, the title cannot contain }
, or the plugin will incorrectly interpret that as the end of the title. Lastly, to create separate accordions, just make sure there is some kind of content (text, a
character, an empty <p>
tag, a <br>
, etc.) separating the mooblocks.
This plugin is listed on the Joomla Extensions Directory.
You can download it here (currently v1.0.4):
If you have any problems using the plugin, wish to report a bug, or have any feature requests, please contact me, Andrew Patton, at:
This plugin is offered in the hope it will be useful but without any warranty whatsoever