ISML Tag - ISNEXT

Name

ISNEXT

Short Description

proceeds to the next element in an iterator <ISLOOP>

The loop is not started with the next element, instead the current iteration is continued using the next element.

Table of Contents

Product Version

6.5

Product To Version

 

Statusfinal

1 Introduction

Loops are blocks of code that are executed repeatedly until a specific condition is met. Use <ISLOOP> to loop through the elements of a specified iterator. For example, using <ISLOOP> you can list iterable data like categories, products, shipping, or payment methods on a web page.
Multiple <ISLOOP> statements can be nested to construct more complex loop structures.
<ISLOOP> has the two supporting tags <ISBREAK> and <ISNEXT>. Both tags can only be used inside the <ISLOOP> tag.
Use <ISBREAK> within an <ISLOOP> construct to unconditionally terminate the loop. If <ISBREAK> is used in a nested loop, it will only terminate the inner loop.
Usually, the <ISBREAK> tag is used within <ISIF> tags to terminate a loop when a certain condition is met.
Use <ISNEXT> to jump forward to the next element in an iterator. In nested loops, this tag affects only the iterator of the inner loop. In case an iterator has already reached its last element, or an iterator is empty when an <ISNEXT> is processed, the loop is terminated instantly.

2 Syntax

<isloop
iterator = "{ISML variable identifier}"
[ alias = "{simple name}" ]
[ counter = "{counter name}" ]
>
... some HTML and ISML code ...
[<isnext>]
[<isbreak>]
</isloop>

3 Example

Here <ISNEXT> is used to output the names of two products one after another:

<ISLOOP iterator= "Products">
  <ISPRINT value="#Products:Name#">
  <ISNEXT>
  <ISPRINT value="#Products:Name#"> <BR>
</ISLOOP>

<ISNEXT> can also be used to organize products in a two-column table.
After data from one loop variable is printed out in the left table column, <ISNEXT> jumps forward to the next element in the list, and prints into the right table column. After that, the loop returns to its beginning to generate the next row of the table.

<isloop iterator="products" alias="hds">
  <tr>
  <!--- first column of hotdeals --->
    <td valign="top" width="50%">
      <ISPRINT value="#hds:Name#"><br>
      <ISPRINT value="#hds:ShortDescription#">
    </td>
  <isnext>
    <td>
    ...
    </td>
    <td valign="top" width="50%">
      <!--- second column of hot deals --->
      <ISPRINT value="#hds:Name#"><br>
      <ISPRINT value="#hds:ShortDescription#">
    </td>
  </tr>
</isloop>

Reference - ISML Tags

Disclaimer

The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Web site, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.

Customer Support
Knowledge Base
Product Resources
Support Tickets