"Repeater" plugin

Parent Previous Next

"ARI Smart Content - Repeater" plugin shows data from the selected data source according to defined template. 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. {repeater} plugin tag is used for the plugin. The following code shows titles and intro text of Joomla! articles in table view (in the sample code data source with ID equals to 7 is Joomla! articles data source):


{repeater source="7"}

       {template}

               {headertemplate}

                       <table class="article-list">

               {/headertemplate}

               {rowtemplate itemCount="2" rowClass="odd;even"}

                       <tr class="{$rowClass}">

                       {celltemplate}

                               <td>

                                       <div><a class="title" href="{$data:readmore_link}">{$data:title}</a>

                                       <div class="description">{$data:introtext}</div>

                               </td>

               {/celltemplate}

                       {emptycelltemplate}

                               <td>&nbsp;</td>

                       {/emptycelltemplate}

                       </tr>

               {/rowtemplate}

               {footertemplate}

                       </table>

               {/footertemplate}

               {emptytemplate}

                       No data available.

               {/emptytemplate}

       {/template}

       {styles}

               TABLE.article-list A.title {font-weight:bold;font-size:1.2em;}

       {/styles}

{/repeater}


The code above produces the following HTML code:


<table class="article-list">

       <tr class="odd">

               <td>

                       <div><a class="title" href="link_to_article1">Title 1</a></div>

                       <div class="description">Description 1<div>

               </td>

               <td>

                       <div><a class="title" href="link_to_article2">Title 2</a></div>

                       <div class="description">Description 2<div>

               </td>

       </tr>

       <tr class="even">

               <td>

                       <div><a class="title" href="link_to_article3">Title 3</a></div>

                       <div class="description">Description 3<div>

               </td>

               <td>

                       <div><a class="title" href="link_to_article4">Title 4</a></div>

                       <div class="description">Description 4<div>

               </td>

       </tr>

       ... end etc. ...

</table>



or the following plugin code can be used to show articles in DIV layout:


{repeater source="7"}

       {template}

               {headertemplate}

                       <div class="article-list">

               {/headertemplate}

               {rowtemplate}

                       {celltemplate}

                               <div class="article-item">

                                       <div><a class="title" href="{$data:readmore_link}">{$data:title}</a>

                                       <div class="description">{$data:introtext}</div>

                               </div>

               {/celltemplate}

               {/rowtemplate}

               {footertemplate}

                       </div>

               {/footertemplate}

               {emptytemplate}

                       No data available.

               {/emptytemplate}

       {/template}

       {styles}

               DIV.article-list A.title {font-weight:bold;font-size:1.2em;}

       {/styles}

{/repeater}


The code above produces the following HTML code:


<div class="article-list">

<div class="article-item">

<div><a class="title" href="link_to_article1">Title 1</a>

<div class="description">Description 1</div>

</div>

<div class="article-item">

<div><a class="title" href="link_to_article2">Title 2</a>

<div class="description">Description 2</div>

</div>

... and etc. ...

</div>


Plugin code syntax


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



Possible to use {template} and {styles} tags inside {repeater} tag to define template how to format data and add custom styles.


The following tags can be placed inside {template} tag:








The following tags can be used inside {rowtemplate} tag:




CSS rules which are defined between {styles} and {/styles} tags will be added to the page where plugin code is used.