{% load i18n ocyan_thumbnail %}
{% if menu_items %}
{% for menu_item in menu_items %}
{% with category_icon=menu_item.category.icons.first %}        
{% if menu_item.has_children %}
<li class="nav-item {% if menu_item.depth == 1 %}head{% else %}child{% endif %} dropdown pages-dropdown">
    <a class="nav-link data-link" href="{{ menu_item.get_absolute_url }}">{{ menu_item.name }}</a>
    <a {% if menu_item.depth == 1 %}class="nav-link" data-bs-toggle="dropdown"{% elif menu_item.depth == 2 %}class="nav-link header" href="{{ menu_item.get_absolute_url }}"{% else %}class="nav-link child" href="{{ menu_item.get_absolute_url }}"{% endif %} aria-expanded="false" class>
        {{ menu_item.name }}
    </a>
    <ul class="dropdown-menu icon-inner-menu">
{% else %}
<li class="nav-item child">
    <a class="nav-link" href="{{ menu_item.get_absolute_url }}">
        {{ menu_item.name }}
    </a>
</li>
{% endif %}
{% for close in menu_item.num_to_close %}
   </ul>
</li>
{% endfor %}
{% endwith %}
{% endfor %}
{% endif %}