This instruction allows to define a content that is put between every two iterations of a loop. It always comes with a parameter "separator" specified in the loop tag, but it has a lower priority while compiling.
Example 2.50. Using separators
{section=navigation} {separator} / {/separator} {$navigation.title} {/section}
The result for three section elements:
Element A / Element B / Element C
The same result can be achieved with the section parameter:
Example 2.51. Separator as a parameter
{section name="navigation" separator="' / '"} {$navigation.title} {/section}
The result for three section elements:
Element A / Element B / Element C
Separators can be also used with for and foreach loops exactly in the same way:
Example 2.52. Separators and other loops
{for begin="@i = 1" end="@i lt 5" iterate="@i++" separator="` / `"} {@i} {/for} <br/> {for begin="@i = 1" end="@i lt 5" iterate="@i++"} {separator} / {/separator} {@i} {/for}
The result:
1 / 2 / 3 / 4 1 / 2 / 3 / 4