{% 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 dropdown">
    <a class="nav-link toggle" href="{{ menu_item.get_absolute_url }}" tabindex="0">
        {{ menu_item.name }} {% if menu_item.depth == 1 %}<i class="fa fa-chevron-down small"></i>{% endif %}
    </a>
    <ul class="dropdown-menu">
{% else %}
<li class="nav-item child">
    <a class="nav-link" href="{{ menu_item.get_absolute_url }}" tabindex="0">
        {{ menu_item.name }}
    </a>
</li>
{% endif %}
{% for close in menu_item.num_to_close %}
   </ul>
</li>
{% endfor %}
{% endwith %}
{% endfor %}
{% endif %}