Displaying stuff only if page has children

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 … :frowning:

{% if sub_sub_sections %}
  <div>html</div>
{% endif %}
---

I have not tested yet, but this should work:

{% if sub_sub_sections|length > 0 %}
  <div>html</div>
{% endif %}

thank you. it is the solution.

or maybe like this:

{% if sub_sections.children.count() > 0 %}
  <div>html</div>
{% endif %}