Break

A break is a way of escaping a loop. This is an extremely useful tool if you want to break execution of a loop when a certain parameter is met.

Example:

{% define $x = 1 %}
{% loop product(current, name, desc) %}
<div>
<a href="{current.product_url}">{current.product_image_tiny}</a>
<p><a href="{current.product_url}">{current.product_name}</a></p>
<p>Part #: {current.attr_part_number}</p>
</div>
{% if $x == 5 %}
{% break %}
{% else %}
{% increment($x) %}
{% endif %}
{% endloop current %}

Start your free, no-risk trial today.