You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Iterates over the content of each item in the attribute value, allowing to control the iteration through the following options:
begin - iteration begins at the item located at the specified index; first item of the collection has index 0
step - iteration will only process every step items of the collection, starting with the first one
end - iteration ends at the item located at the specified index (inclusive)
Element: shown only if the number of items from the attribute value is greater than 0, or if the attribute value is a string or number; when the begin value is used the element will be shown only if the begin value is smaller than the collection's size.
"
Expected Behaviour
I should be able to use data-sly-list for just one element even though it is the first item of a list.
Actual Behaviour
I can use data-sly-list for just one element as long as it is not the first element of a list because the "end" option cannot be "0". This is not stated in the specification but it can be seen in the compiled code:
Just write the following code in any valid htl file.
<p>The following test is OK and it should print "2"</p>
<ul data-sly-list="${[1, 2, 3] @ begin = 1, end = 1}">
<li>${item}</li>
</ul>
<p>The following test is not OK and it should print "1" but it does not print the list because the "end" option cannot be "0"</p>
<ul data-sly-list="${[1, 2, 3] @ begin = 0, end = 0}">
<li>${item}</li>
</ul>
Example:
Download the latest SDK and install the Core Components project
<p>The following test is OK and it should print "2"</p>
<ul data-sly-list="${[1, 2, 3] @ begin = 1, end = 1}">
<li>${item}</li>
</ul>
<p>The following test is not OK and it should print "1" but it does not print the list because the "end" option cannot be "0"</p>
<ul data-sly-list="${[1, 2, 3] @ begin = 0, end = 0}">
<li>${item}</li>
</ul>
Logs taken while reproducing problem
No logs needed
The text was updated successfully, but these errors were encountered:
Here is the specification: https://github.com/adobe/htl-spec/blob/master/SPECIFICATION.md#226-list
"
"
Expected Behaviour
I should be able to use data-sly-list for just one element even though it is the first item of a list.
Actual Behaviour
I can use data-sly-list for just one element as long as it is not the first element of a list because the "end" option cannot be "0". This is not stated in the specification but it can be seen in the compiled code:
boolean var_validstartstepend16 = (((org.apache.sling.scripting.sightly.compiler.expression.nodes.BinaryOperator.lt(var_begin13, var_size11)) && ((!(org.apache.sling.scripting.sightly.compiler.expression.nodes.BinaryOperator.lt(var_begin13, 0))) && true)) && (!(org.apache.sling.scripting.sightly.compiler.expression.nodes.BinaryOperator.leq(var_end15, 0))));
Reproduce Scenario (including but not limited to)
Steps to Reproduce
Just write the following code in any valid htl file.
Example:
Platform and Version
Any (Cloud and 6.5 for example).
Sample Code that illustrates the problem
Logs taken while reproducing problem
No logs needed
The text was updated successfully, but these errors were encountered: