{% load menu_tags %} {% for item in menu_items %} {% if item.has_children_in_menu %} {% else %} {% endif %} {% endfor %}