Modifier: is_empty
Checks to see if an array is empty without any set values. Works with numeric indexes, associative, and string keyed arrays of all depths. It’s pretty smart, as these things go.
YAML
some_data:
- is living here
more_data:
with:
hopes:
and:
dreams:
-
Template
{{ if some_data | is_empty }}
{{ if more_data | is_empty }}
Output
false
true
Additional Reading
Learn how to use and chain modifiers in the Antlers template guide.