Caution: This documentation is for eZ Publish legacy, from version 3.x to 6.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.

sequence

Summary

Creates a sequence that can be iterated.

Usage

{sequence name=name loop=loop}

Parameters

NameTypeDescriptionRequired
name string The name of the target namespace. Yes.
loop array The iteration elements (as an array). Yes.

Description

This function allows the creation of a sequence which can be iterated. If the number of iterations exceed the length of the sequence, the contents of the sequence will be wrapped and thus repeated. It is typically useful when it comes to the creation of lists / tables with alternating colors. Both the name and the elements (which will be iterated) must be defined.

Balazs Halasy (06/02/2004 1:23 pm)

Balazs Halasy (28/04/2005 2:01 pm)


Comments

  • how it actually works

    So this is how it actually works. Should work in any kind of loop or iteration, the {sequence name='bgtype'} just activates next value at each call.

    {sequence name='bgtype' loop=array('bglight', 'bgdark')}
    {for 0 to $numRows as $rowNr}
    {sequence name='bgtype'}
    <tr class="{$bgtype:item}">
    ....