SSL Labs ScoreSecurityHeaders.io ScoreHSTS Preloaded

MooAccordion 1.9

Overview

Easily implement accordion content within your articles, category descriptions or HTML modules.

Installation

  1. Download MooAccordion from the RicheyWeb download page.
    • This page will remain unlinked, as the link may change in the future. Visit http://www.richeyweb.com and use the search feature - search for "MooAccordion".
  2. In Joomla /administrator, go to the "Extensions" menu, the "Manage" sub-menu, and the "Install" sub-menu.
  3. Select the "Upload Package File" tab
  4. Press the "Choose File" button to browse your system and locate the plugin file you downloaded
  5. Press the "Upload & Install" button

At this point, the extension is installed but not enabled. You can find the plugin by going to the Extensions menu and selecting "Plugins". When in the plugin manager, search for "MooAccordion".

Configuration

The only available configuration within the plugin is CSS to be applied when the accordion is used. This is entirely optional as the plugin does not require it.

Usage

This plugin searches for the existence of the 'mooaccordion' class and renders clickable headings for collapsable accordion content.

Each item found with the mooaccordion class is paired with the tag immediately following it.

Simple Usage:

<strong class="mooaccordion">Accordion Label 1</strong>
<p>Accordion Content 1 ...</p>
<strong class="mooaccordion">Accordion Label 2</strong>
<p>Accordion Content 2 ...</p>
<strong class="mooaccordion">Accordion Label 3</strong>
<div>
  <p>Accordion Content 3 paragraph 1 ...</p>
  <p>Accordion Content 3 paragraph 2 ...</p>
</div>

MooAccordion locates all items with the mooaccordion class and puts them into a common container with each label containing the click activation for the accordion effect.

The label and content tags are not important. Note content 3 contains 2 paragraphs. In order to associate both paragraphs with the accordion label, they are both contained within a div tag. This is done because the plugin identifies the 1st tag following the accordion label as the accordion content.

Advanced Usage:

<div>
  <h2>Accordion Group 1</h2>
  <strong class="mooaccordion">Accordion Label 1</strong>
  <p>Accordion Content 1 ...</p>
  <strong class="mooaccordion">Accordion Label 2</strong>
  <p>Accordion Content 2 ...</p>
  <strong class="mooaccordion">Accordion Label 3</strong>
  <div>
    <p>Accordion Content 3 paragraph 1 ...</p>
    <p>Accordion Content 3 paragraph 2 ...</p>
  </div>
</div>
<div>
  <h2>Accordion Group 2</h2>
  <strong class="mooaccordion">Accordion Label 1</strong>
  <p>Accordion Content 1 ...</p>
  <strong class="mooaccordion">Accordion Label 2</strong>
  <p>Accordion Content 2 ...</p>
  <strong class="mooaccordion">Accordion Label 3</strong>
  <div>
    <p>Accordion Content 3 paragraph 1 ...</p>
    <p>Accordion Content 3 paragraph 2 ...</p>
  </div>
</div>

MooAccordion is capable of implementing multiple accordion groups. Groups are created based on their parent element. All elements with the mooaccordion class are associated with their parent item. Each parent is then processed with a unique accordion group.

In order to implement multiple groups, the grouped items must be contained within different parent elements. The example above will create 2 independent groups of accordion items. In this case, 2 items can be open simultaneously (1 from each group).

Nested Usage:

<div>
  <strong class="mooaccordion">Accordion Level 0.1</strong>
  <div>
    <strong class="mooaccordion">Accordion Level 1.0.1</strong>
    <div>
      <strong class="mooaccordion">Accordion Level 3.1.1</strong>
      <div>Level 3 - item 1</div>
    </div>
    <strong class="mooaccordion">Accordion Level 1.0.2</strong>
    <div>Level 2 - item 2</div>
    <strong class="mooaccordion">Accordion Level 1.0.3</strong>
    <div>Level 2 - item 3</div>
  </div>
  <strong class="mooaccordion">Accordion Level 0.2</strong>
  <div>Level 1 - item 2</div>
  <strong class="mooaccordion">Accordion Level 0.3</strong>
  <div>
    <p>Level 1 - item 3 - paragraph 1<p>
    <p>Level 1 - item 3 - paragraph 2<p>
  </div>
</div>

Using the plugin tag

One plugin tag within the content per accordion group to be modified. Groups with no modifications will be displayed with defaults. It is not necessary to include plugin options for every accordion group that you intend to be displayed with defaults.

  • id='cssid': HTML ID of the parent item which these settings will apply.
  • allowallclosed: Flags the accordion group to allow all items to be closed
  • display='number': Logical number of the item to be open by default. Note, the first item in an accordion list is 0.
  • openedclass='[classnames]': CSS classes applied to open accordion items.
  • closedclass='[classnames]': CSS classes applied to closed accordion items.
  • template='number': Pre-defined CSS template to be used on this accordion group. Using this feature overrides the openedclass and closedclass options. Three pre-defined templates are included with this plugin and are numbered 1, 2 and 3.

Examples

<div id="myaccordionid">
  <strong class="mooaccordion">Accordion Label 1</strong>
  <div>Accordion Content 1 ...</div>
  <strong class="mooaccordion">Accordion Label 2</strong>
  <div>Accordion Content 2 ...</div>
  <strong class="mooaccordion">Accordion Label 3</strong>
  <div>
    <p>Accordion Content 3 paragraph 1 ...</p>
    <p>Accordion Content 3 paragraph 2 ...</p>
  </div>
</div>
  • {content-mooaccordion id='myaccordionid' allowallclosed}
    • This accordion will be displayed with defaults and all items will be hidden.
  • {content-mooaccordion id='myaccordionid' default='2'}
    • The third item will be opened on page load.
  • {content-mooaccordion id='myaccordionid' template='2'}
    • The 2nd template will be used
  • {content-mooaccordion id='myaccordionid' openedclass='mymooopenclass'}
    • 'mymooopenclass' will be added to the toggler class list when an item is opened. When the item is closed, the class will be removed.
  • {content-mooaccordion id='myaccordionid' closedclass='mymoocloseclass'}
    • 'mymoocloseclass' will be added to the toggler class list when an item is closed. When the item is opened, the class will be removed.
  • {content-mooaccordion id='myaccordionid' closedclass='mymoocloseclass' id='myaccordionid2' template='2'}
    • Customizing 2 accordions.

Important Notes

  1. Accordion labels will contain the mooaccordion class and will also contain mooaccordionN (where N is the number of the accordion group)
  2. Toggler icons will always have a class 'mooaccordionicon' and be found as the first child of the outermost tag of the toggler element.
  3. Accordion groups not customized will receive a 'mooaccordiondefaulttoggle' class.
  4. Accordion content may appear strange if content or toggler items are different types. For example, the first content is a p and the second is a div - the first may not fully collapse due to p margins where the div has none. The solution is to wrap all content in a common tag (div is recommended). Both examples above illustrate this behavior if your template has assigned a margin to the p tag.

HELP