{% load navigation wagtailcore_tags %}

<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
  <ul class="nav navbar-nav navbar-right">
  {% for menuitem in menuitems %}
    <li class="{% if menuitem.show_dropdown %}dropdown{% endif %}{% if menuitem.active %} active{% endif %}">
        {% if menuitem.show_dropdown %}
            <a data-toggle="dropdown" class="dropdown-toggle" href="#">{{ menuitem.title }} <b class="caret"></b></a>
            {% top_menu_children parent=menuitem %}
        {% else %}
            <a href="{% pageurl menuitem %}">{{ menuitem.title }}</a>
        {% endif %}
    </li>       
  {% endfor %}
  </ul>
</div>
<!-- /.navbar-collapse -->
