Sightly List size
Hi all,
I have used list of child page using Sightly but i want to get the size of that list.
<Sly data-sly-list=${current page.listChildren}>
I want size , i tried itemList.size and item list.length
But it is not working.
Hi all,
I have used list of child page using Sightly but i want to get the size of that list.
<Sly data-sly-list=${current page.listChildren}>
I want size , i tried itemList.size and item list.length
But it is not working.
Hi,
HTL does not provide any method to get list size.
https://github.com/adobe/htl-spec/blob/master/SPECIFICATION.md#226-list
I would recommend to use java suggested by @ksh_ingole7
But If you are curious about how to do it in HTL, I can tell but this is not an optimal solution, you may end up parsing list twice.
<sly data-sly-list="${currentPage.listChildren}">
<sly data-sly-test="${itemList.last}" data-sly-set.aListSize="${itemList.count}" />
</sly>
List size is : ${aListSize}Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.