{% load default_tags %}{% load mptt_tags %}{% load djacore_tags %}

{% recursetree nodes %}
    <li class="{% if node.tree_depth == 0 %}nav-item{% endif %} {% if not node.is_leaf_node %}dropdown{% endif %}">
        {% if not node.is_leaf_node %}<a class="nav-link dropdown-toggle" href="{{ node.get_absolute_url }}" role="button" data-bs-toggle="dropdown" aria-expanded="false">{{ node.name }}</a>{% elif node.tree_depth == 0%}<a class="nav-link" href="{{ node.get_absolute_url }}">{{ node.name }}</a>{% else %}<a class="dropdown-item" href="{{ node.get_absolute_url }}">{{ node.name }}</a>{% endif %}
        {% if not node.is_leaf_node %}
            <ul class="dropdown-menu">
                {{ children }}
            </ul>
        {% endif %}
    </li>
{% endrecursetree %}



