Skip to content

Instantly share code, notes, and snippets.

@Mikescops
Created May 14, 2018 15:01
Show Gist options
  • Save Mikescops/f7aa4f7702113cb92d1418039d4827d0 to your computer and use it in GitHub Desktop.
Save Mikescops/f7aa4f7702113cb92d1418039d4827d0 to your computer and use it in GitHub Desktop.
Universal Bolt Menu template made with and for Bootstrap 3.0 by Corentin Mors (7 Jan 2014)
<nav class="navbar navbar-default" role="navigation">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{ paths.root }}">{{ app.config.general.sitename }}</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<!-- Start of Twig Templating -->
{% for item in menu %}
<li class="{% if item.submenu is defined %}dropdown{% else %} index-{{ loop.index }}{% if loop.first %} first{% endif %}{% if loop.last %} last{% endif %}{% if item|current %} active{% endif %}{% endif %}">
<a href="{% if item.submenu is defined %}#{% else %}{{ item.link }}{% endif %}" {% if item.title is defined %}title='{{ item.title|escape }}'{% endif %}
class='{% if item.submenu is defined %}dropdown-toggle{% else %}{% if item.class is defined %}{{item.class}}{% endif %}{% endif %}' {% if item.submenu is defined %}data-toggle="dropdown"{% endif %}>
{{item.label}} {% if item.submenu is defined %}<b class="caret"></b>{% endif %}
</a>
{% if item.submenu is defined %}
<ul class="dropdown-menu">
{% for item in item.submenu %}
<li>
<a href="{{ item.link }}" {% if item.title is defined %}title='{{ item.title|escape }}'{% endif %}>
{{item.label}}
</a>
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
<!-- End of Twig -->
</ul>
</div><!--/.nav-collapse -->
</nav><!-- /navbar-inner -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment