  
  <nav class="navbar {{navbar_classes}}">
    <div class="{{navbar_container}} {% if vertical %}ms-0{%endif%}">
      <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent{% if vertical %}V{%endif%}_{{target}}" aria-controls="navbarSupportedContent{% if vertical %}V{%endif%}_{{target}}" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>
      {% if brand_image %}
        <a class="navbar-brand" href="{{brand_url}}">
          <img src="{{brand_image}}" alt="{{brand_text}}" {% if brand_image_width %} width="{{brand_image_width}}"{% endif %}>
        </a>
      {% elif brand_text %}
        <a class="navbar-brand" href="{{brand_url}}">{{brand_text}}</a>
      {% endif %}

      <div class="collapse navbar-collapse" id="navbarSupportedContent{% if vertical %}V{%endif%}_{{target}}">
        
        <ul class="navbar-nav me-1">
          {% for item,data in menu.items %}
            {% if data.kind == 'item' %}
              <li class="nav-item">
                <a class="nav-link {% if item == active %}active{% endif %}" href="{{data.url}}{{data.extra}}">
                  {% if vertical %}{{item|truncatechars:28}}{% else %}{{item}}{% endif %}
                  {% if item == active %}<span class="sr-only visually-hidden visually-hidden-focusable">(current)</span>{% endif %}
                  </a>
              </li>
            {% elif data.kind == 'submenu' %}
              <li class="nav-item dropdown"> 
                <a class="nav-link dropdown-toggle {% if item == active %}active{% endif %} pe-0" href="#" id="wildewidget_submenu_{{item|cut:' '}}" role="button" data-bs-toggle="dropdown" data-bs-auto-close="true" aria-haspopup="true" aria-expanded="{% if item == active and vertical %}true{% else %}false{% endif %}">
                  {{item}}
                </a>                  
                <div class="dropdown-menu {% if item == active and vertical %}show{% endif %}" aria-labelledby="wildewidget_submenu_{{item|cut:' '}}">
                  {% for subitem in data.items %}
                    {% if subitem.divider %}
                      <div class="dropdown-divider"></div>
                    {% else %}
                      <a class="dropdown-item {% if subitem.active %}active{% endif %}" href="{{subitem.url}}{{subitem.extra}}">{% if vertical %}{{subitem.title|truncatechars:21}}{% else %}{{subitem.title}}{% endif %}</a>
                    {% endif %}
                  {% endfor %}
                </div>
              </li>
            {% else %}
              <li class="nav-item">
                <a class='nav-link' href='#'>{{data.kind}}</a>
              </li>
            {% endif %}
            <!-- 
            This is an example of how to do vertical dividers for when i later implement them. 
            {% if forloop.last %}
              <li class="nav-item"><a href='#' class="nav-link pe-0"><div class="w-100 border-bottom borderx-light"></div></a></li>
            {% endif %} -->
          {% endfor %}
        </ul>
      </div>
    </div>
  </nav>
