Template Instructions / Template Instructions |
For a specified collection, iterate through the collection and repeat the element, once per item in the collection.
<tag gwc:repeat="elt eltList"> statements </tag>
<div gwc:repeat="item menu/actions"> <a href="..." gwc:condition="item/text" gwc:define="text item/text" gwc:attributes="href document/URL + '?' + item/IDID" gwc:content="text">Input</a> </div>
Displays the text of each action of a menu as an HTML link.
The following table lists special template paths for use with a gwc:repeat instruction. For more information on template paths, see Template Paths for the Snippet-Based Rendering Engine.
Template Path | Type | Component | AUI object |
---|---|---|---|
repeat | object | ||
repeat/elt | object |
Template Path | Type | Description | Attribute Type |
---|---|---|---|
repeat/elt/length | attribute | Get the length of the repeat sequence (the number of elements in the sequence). | number |
repeat/elt/index | attribute | Get the index of the current element in the sequence, starting with 0 (zero). | number |
repeat/elt/first | attribute | Test if the current repeat element is the first element of the sequence | boolean |
repeat/elt/last | attribute | Test if the current repeat element is the last element of the sequence | boolean |
repeat/elt/even | attribute | Test if the current repeat element is an even element of the sequence | boolean |
repeat/elt/odd | attribute | Test if the current repeat element is an odd element of the sequence | boolean |