"Accordion" plugin

Parent Previous Next

"ARI Smart Content - Accordion" plugin creates accordions in Joomla! content. The plugin can be enabled/disabled and configured on "Extensions → Plugin Manager" page on Joomla! backend. Common information how to use "ARI Smart Content" applications plugins is here. {accordion} plugin tag is used for the plugin. The following code creates an accordion with three items which are defined manually:


{accordion}

       {item title="Item 1"}

               This is the first item

       {/item}

       {item title="Item 2"}

               This is the second item

       {/item}

       {item title="Item 3"}

               This is the third item

       {/item}

{/accordion}


As you can see accordion items are defined using {item}...{/item} code. {item} tag supports title attribute where title for the accordion item is defined. Any HTML code can be used between {item} and {/item} tags. It is possible to create nested accordions. The sample code below:


{accordion width="80%"}

       {item title="Item 1"}

               This is the first item

       {/item}

       {item title="Item 2"}

               The nested accordion below


               {accordion}

                       {item title="Sub-item 1"}

               This is the first item of child accordion

       {/item}

                       {item title="Sub-item 2"}

               This is the second item of child accordion

       {/item}

               {/accordion}

       {/item}

       {item title="Item 3"}

               This is the third item

       {/item}

{/accordion}


One note, if you want to use nested accordions then set "Height" parameter to "Content" value in plugin settings or add heightStyle="content" attribute to {accordion} tag. It is also possible to create accordions based on data from Text data data sources. In this case use source attribute of {accordion} tag to define ID of the data source. For example you have created a data source (and ID of this data source is 5) which selects Joomla! articles from the selected categories and what to create an accordion based on these articles. Use the following plugin code:


{accordion source="5"}

{/accordion}


In this case accordion items titles and content will be formatted according to values of "Title template" and "Template" parameters from plugin settings. Possible to use itemTemplate and titleTemplate attributes of {accordion} tag to define custom formatters:


{accordion source="5" titleTemplate="{$title} [{$created}]" itemTemplate="{$introtext}"}

{/accordion}



Plugin settings


The following parameters can be defined on plugin settings page ("Extensions → Plugin Manager → ARI Smart Content - Accordion" page on Joomla! backend):
















Plugin code syntax


The following attributes can be used for {accordion} tag:



{accordion active="1"}

       {item title="Item 1"}

               This is the first item

       {/item}

       {item title="Item 2"}

               This is the second item

       {/item}

       {item title="Item 3"}

               This is the third item

       {/item}

{/accordion}


or the following code if want to show all items in closed state:


{accordion active="-1" collapsible="1"}

       {item title="Item 1"}

               This is the first item

       {/item}

       {item title="Item 2"}

               This is the second item

       {/item}

       {item title="Item 3"}

               This is the third item

       {/item}

{/accordion}



{accordion collapsible="0"}

       {item title="Item 1"}

               This is the first item

       {/item}

       {item title="Item 2"}

               This is the second item

       {/item}

       {item title="Item 3"}

               This is the third item

       {/item}

{/accordion}



{accordion duration="600"}

       {item title="Item 1"}

               This is the first item

       {/item}

       {item title="Item 2"}

               This is the second item

       {/item}

       {item title="Item 3"}

               This is the third item

       {/item}

{/accordion}



{accordion event="mouseover"}

       {item title="Item 1"}

               This is the first item

       {/item}

       {item title="Item 2"}

               This is the second item

       {/item}

       {item title="Item 3"}

               This is the third item

       {/item}

{/accordion}



{accordion heightStyle="content"}

       {item title="Item 1"}

               This is the first item

       {/item}

       {item title="Item 2"}

               This is the second item

       {/item}

       {item title="Item 3"}

               This is the third item

       {/item}

{/accordion}




The following code set animation effect to easeInBack value:


{accordion fx="easeInBack"}

       {item title="Item 1"}

               This is the first item

       {/item}

       {item title="Item 2"}

               This is the second item

       {/item}

       {item title="Item 3"}

               This is the third item

       {/item}

{/accordion}