myshop-repeat-products:< all | times n | test conditie >
Entity | Value |
---|---|
Attribute(s) | style |
Type | repeat loop |
Relation | myshop-block:productlist |
The myshop-repeat-products:<option>
addition can be used to compile a product list. By setting a condition the number of products to be displayed can be controlled. The myshop-repeat-products addition must be placed inside a myshop-block-productlist in order to build a conditional product list. The condition ‘all’ can be used to display all products. The option 'times'<number>
a specific number of repeats can be set. Writing other conditions – the condition test – is identical to the one for the addition myshop-test:<condition>
.
The code fragment below gives an example for using a myshop-repeat-products addition with a condition {$equalsNext(1)}
. The table with the field value of the rows of column one of the product lists is displayed until the value of the present row is unequal to the one in the next row. In the latter case new head line and footnote will be written. Everything will be repeated until all products have been displayed.
<td style="myshop-block:productlist" align="center">
kopregel
<table style="myshop-repeat-products:{$equalsNext(1)}">
<tr>
<td valign="top">
<span style="myshop-value:1;">value 1</span>
</td>
</tr>
</table>
voetregel
</td>
The next example contains an example of the use of the myshop-repeat-products:times n addition. By using the option times 4 a maximum of 4 products are placed on the table’s row.
<td style="myshop-block:productlist" align="center">
kopregel
<table>
<tr>
<td valign="top" style="myshop-repeat-products:times 4">
<span style="myshop-value:1;">value 1</span><br/>
<span style="myshop-value:2;">value 2</span><br/>
</td>
</tr>
</table>
voetregel
</td>
Post your comment on this topic.