Salesforce B2C Commerce 23.6 > Developing Your Site > Development Components > Templates > ISML

isbreak Element

Terminate loops unconditionally.

Syntax

<isbreak/>

Purpose

<isbreak> can be used within a loop (defined by an <isloop> tag) to terminate a loop unconditionally. For more information on creating loops see <isloop>. If <isbreak> is used in a nested loop, it terminates only the inner loop.

Example

In this example, <isbreak/> terminates the loop after showing three product names; even if the products iterator contains more than three products.

<isset name="counter" value="${0}">
<isloop iterator="${pdict.Basket.product}" var="product" status="status">
  <isprint value="${product.name}"> <BR>
  <isif condition="${status.counter >= 3}">
    <isbreak/>
  </isif>
</isloop>
X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used. By continuing to use this site you are giving us your consent to do this. Privacy Policy.