Can we use %(modulo) in Sightly
I want to use below condition in sightly, how can I use it
<ul data-sly-list="${properties.size}">
<li data-sly-test="${itemList.count % 3 ==0}"> Test </li>
</ul>
I know above code don't work. How to achieve above condition in sightly.
Solved! Go to Solution.
Views
Replies
Total Likes
HTL (formerly known as Sightly ) only supports logical and comparison operators. It is intended as the view rendering scripts are not supposed to contain business logic, this should come from the model/use-objects/Js use-api.
Spec:- htl-spec/SPECIFICATION.md at master · Adobe-Marketing-Cloud/htl-spec · GitHub
Js Use-API: HTL JavaScript Use-API
Feike Visser Please correct me if I am wrong here.
~kautuk
Views
Replies
Total Likes
HTL (formerly known as Sightly ) only supports logical and comparison operators. It is intended as the view rendering scripts are not supposed to contain business logic, this should come from the model/use-objects/Js use-api.
Spec:- htl-spec/SPECIFICATION.md at master · Adobe-Marketing-Cloud/htl-spec · GitHub
Js Use-API: HTL JavaScript Use-API
Feike Visser Please correct me if I am wrong here.
~kautuk
Views
Replies
Total Likes
No %-modulo can't be used. However it is a great improvement to HTL/Sightly.
Would you mind to raise a sling-ticket on this?
Thanks kautuksahni & Feike Visser
Will raise sling ticket for the same.
Views
Replies
Total Likes
Let me know the ticket, so I can help to expedite it.
Views
Replies
Total Likes
Would be great to have this functionality. If i need to render a list, and do something specific for every 5th element, ${itemList.index % 5 == 0} would be very useful.
Views
Replies
Total Likes
Raise a sling jira-ticket for it.
Views
Replies
Total Likes
@Feike_Visser1 Any updates on this ticket?
Views
Replies
Total Likes
@Feike_Visser1 @kautuk_sahni hi, what is the update on this feature? Was it ever implemented from the Jira ticket logged?
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies