Muut
1
I’d like to test if a page has children and showing html content only if it has children.
{% set sub_sub_sections = sub_section.children %}
this is the test, but it renders the html content anyway …
{% if sub_sub_sections %}
<div>html</div>
{% endif %}
---
Muut
2
I have not tested yet, but this should work:
{% if sub_sub_sections|length > 0 %}
<div>html</div>
{% endif %}
Muut
3
thank you. it is the solution.
Muut
4
or maybe like this:
{% if sub_sections.children.count() > 0 %}
<div>html</div>
{% endif %}