Solved
How do I get the multifield count in a component AEM?
Actually, I need to get the multifield count in the component, and then I need to use that count in the HTL. Is there any way to get the multifield count?
Actually, I need to get the multifield count in the component, and then I need to use that count in the HTL. Is there any way to get the multifield count?
@ameen_dev HTL does not offer a way to get the list size either, however it allows getting interesting properties of the current item:
* index: zero-based counter (0..length-1); * count: one-based counter (1..length); * first: true for the first element being iterated; * middle: true if element being iterated is neither the first nor the last; * last: true for the last element being iterated; * odd: true if count is odd; * even: true if count is even.
e.g. If you want to display the whole list count
<sly data-sly-test.totalItems="${0}"></sly> <sly data-sly-list.child="${resource.listChildren}"> <sly data-sly-test.totalItems="${ childList.count }"></sly> </sly>
${ totalItems } - this will give you the number of items in the list.
Thanks
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.