{% 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">
<button class="nav-link toggle btn btn-link p-0 border-0 bg-transparent" type="button" aria-haspopup="true" aria-expanded="false">
        {{ menu_item.name }}<i class="fa fa-chevron-down small ms-2"></i>
    </button>
    <ul class="{% if mega_menu %}megasubmenu{% else %}dropdown-menu{% endif %}">
{% 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 %}
