0

Is there a way to test if listChildren will return anything? Something along the line of: <sly data-sly-test=${item.listChildren.size > 0} />

Arielle Adams
  • 98
  • 2
  • 10

1 Answers1

3

Assuming this is a followup of Sightly Implicit Objects, the listChildren method will return an Iterator. You can check it’s not empty by calling its hasNext method:

<sly data-sly-test=“${item.listChildren.hasNext}”>
Vlad
  • 10,602
  • 2
  • 36
  • 38