6

Using data-sly-list I can iterate over a list object in Sightly, but how can I check if a list is empty? data-sly-list simply renders nothing on empty list objects and I need to display an alternativ text if the list contains no items.

Thanks

Markus Haack
  • 103
  • 1
  • 1
  • 7

1 Answers1

17

Use data-sly-test and ! operator:

<div data-sly-test="${!myList}">List is empty</div>
Tomek Rękawek
  • 9,204
  • 2
  • 27
  • 43