  
  <nav class="navbar {{navbar_classes}}">
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>

    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <div class="{{navbar_container}}">
        <ul class="navbar-nav mr-auto">
          {% 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}}">
                  {{item}}
                  {% 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 %}" href="#" id="wildewidget_submenu_{{item|cut:' '}}" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                  {{item}}
                </a>
                <div class="dropdown-menu" aria-labelledby="wildewidget_submenu_{{item|cut:' '}}">
                  {% for subitem in data.items %}
                    {% if subitem.divider %}
                      <div class="dropdown-divider"></div>
                    {% else %}
                      <a class="dropdown-item" href="{{subitem.url}}{{subitem.extra}}">{{subitem.title}}</a>
                    {% endif %}
                  {% endfor %}
                </div>
              </li>
            {% else %}
              <li class="nav-item">
                <a class='nav-link' href='#'>{{data.kind}}</a>
              </li>
            {% endif %}
          {% endfor %}
        </ul>
      </div>
    </div>

  </nav>
