Multi-level Bootstrap 4 Navbar With Navee


You want to setup a Bootstrap 4 Navbar and use Navee to manage the navigation menu in Craft.


This was built for Bootstrap v4.0.0-alpha.6 and Navee 1.3.0.

Step 1: Download and Install Navee

Go to and download Navee.

Step 2: Download and Install latest Bootstrap 4 build

Currently v4.0.0-alpha.6 which you can get at

Step 3: Build Navigation in Navee

Setup your 2 level navigation menu in Navee. Call it Main Navigation so the handle is mainNavigation.

Step 4: Code it out

Setup your template code as follows:

<nav class="navbar navbar-toggleable-md navbar-light bg-faded">
  <div class="logo"><img src="/assets/layout/logo.png"></div>
  <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  <a class="navbar-brand" href="{{ siteUrl }}">{{ siteName }}</a>

  <div class="collapse navbar-collapse" id="navbarNavDropdown">

    {% set navConfig = {
      'startwithActive' : true,
      'maxDepth' : 2,
    } %}

    {% set navigation = craft.navee.getNav('mainNavigation', navConfig) %}

    <ul class="navbar-nav ml-auto">
      {% for node in navigation %}
        <li class="nav-item{% if node.hasDescendants() %} dropdown{% endif %}">
          {% if node.hasDescendants() and node.level == 1 %}
          <a href="{{ }}" class="nav-link dropdown-toggle" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{ node.title }}</a>
            <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
              {% set subNodes = node.getChildren() %}
              {% for subNode in subNodes %}
                <a class="dropdown-item" href="{{ }}">{{ subNode.title }}</a>
              {% endfor %}
          {% elseif node.level == 1 %}
            <a href="{{ }}" class="nav-link">{{ node.title }}</a>
          {% endif %}
      {% endfor %}

  </div><!--/.navbar-collapse -->


As new Bootstrap 4 releases come out you may need to tweak the Navbar code. Just watch their changelog for any changes to the Navbar component.