{% load cms_admin i18n adminmedia %}<li id="page_{{page.pk}}" class="{% if cl.is_filtered %}leaf{% endif %}{% if has_move_page_permission %} moveable{% endif %}{%if page.children.exists %} closed{% endif %}"{% if metadata %} mdata="{{ metadata }}{% endif %}" rel="{% ifequal page.level 0 %}topnode{% else %}node{% endifequal %}">
    
    {% include 'admin/cms/page/menu_item.html' %}
    
    {% if page.children.exists %}<ul{% if page.last %} class="last"{% endif %}>
    </ul>{% endif %}
</li>



{% load cms_admin i18n adminmedia %}{% with page.children.exists as has_children %}<li id="page_{{page.pk}}" class="{% if cl.is_filtered %}leaf{% endif %}{% if has_move_page_permission %} moveable{% endif %}{%if has_children %} closed{% endif %}"{% if metadata %} mdata="{{ metadata }}{% endif %}" rel="{% ifequal page.level 0 %}topnode{% else %}node{% endifequal %}">
    
    {% include 'admin/cms/page/menu_item.html' %}
    
    {% has_children %}<ul{% if page.last %} class="last"{% endif %}>
    </ul>{% endif %}
</li>
{%  endwith %}
Use {% with %} as a further optimization
Use {% with %} as a further optimization
