equalsPrevious (kolom|kolomnaam)
Entity | Value |
---|---|
Attribute(s) | style, href, title, alt, value, name, onclick |
Type | function, value |
Context | myshop-block:productlist, myshop-repeat-products:< conditie > |
Parameters | 1: column number / column name |
Result | true / false |
With the function equalsPrevious one can check if a value from the current active row is equal to the value in the previous row. The number of the column to check can be given as parameter, or the name of the column. The result is True if the values are identical to each other. The function can be used to change the layout when values in the fields change.
The example below shows an extra message when one of the fields 3 and 4 of the productlist is different from the value from the previous row. By using the operation not() and combining the fields with the boolean operation and/or one can combine multiple fields and check if they are not equal to each other.
<tr style="myshop-has-value:3">
<td class="mediumBold" width="33%" style='myshop-label:3;color:red'>label 3</td>
<td>
<span style="myshop-test:not({$equalsPrevious(4)} and {$equalsPrevious(3)})">not equal to previous</span>
<span style="myshop-value:3">3</span>
</td>
</tr>
Post your comment on this topic.