Simple loop constructs enables iteration through various items such as news items, products, variants, countries, etc.

A loop construct begins with LoopStart(items) and ends with LoopEnd(items). The name in the parentheses defines what is being iterated. HTML code and other template tags can be put in between the two loop tags.

(Loops are only available in templates where this is explicitly stated.)

Related tags

The following two tags can be used to display some text when there are items to loop:

  • LoopStart(loop name)
  • LoopEnd(loop name)

The following tags can be used at the beginning and end of a loop. The tags will result in the loop only being displayed if the loop contains items:

  • HeaderStart
  • HeaderEnd
  • FooterStart
  • FooterEnd

The following tag can be used to display a message when there are no items in a loop:

  • EmptyLoopStart
  • EmptyLoopEnd

The following tags are available for all loops:


Example of usage

The following example illustrates how to use a loop construct to list products in a table:


 The following example illustrates how to use the EmptyLoop, Header and Footer loops in a simple loop construct:

<!--@EmptyLoopStart-->No items in this loop <!--@EmptyLoopEnd-->


The DwTemplateTags list only outputs the first 5 loop items if it is in a loop - to avoid huge amounts of markup.

Loops are outputtet with link to the documentation like the normal tags and can also be copied.