{run-once} ... {/run-once}
This function makes sure that a block of template code is processed only once within a page view. It is typically useful when it comes to displaying elements that should appear once or to do timeconsuming calculations that only has to be processed once (and the result is included in multiple templates).
{def $elements=array( 'A', 'B', 'C' )} {foreach $elements as $element} {run-once} Hello world <br/> {/run-once} {$element} <br /> {/foreach}
The following output will be produced:
Hello World
A
B
C