Skip to the content
Documentation

An example of using a foreach loop instead of the deprecated section?

No ratings yet

Hi. Could someone provide an example of how to use a foreach loop instead of the deprecated section loop. Let's say I have the following code and want to use a foreach loop instead of a section:

<div class="listItem">
{default node_name=$node.name node_url=$node.url_alias}
{foreach (
{section show=$node_url}<a href={$node_url|ezurl}>{/section}{$node_name|wash}{section show=$node_url}</a>{/section}{/default}
</div>

Thanks.