Skip to content

Commit 86f1b5a

Browse files
committed
Add possibility to use bootstrap4.
1 parent 65da313 commit 86f1b5a

File tree

4 files changed

+42
-6
lines changed

4 files changed

+42
-6
lines changed
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
1+
<ul class="dropdown-menu">
22
{% for item in items %}
33
{% if item.visible %}
4-
<a class="dropdown-item {% if item.selected %} active{% endif %}{% if item.children %} dropdown-submenu{% endif %}" href="{{ item.url }}">{{ item.title }}
4+
<li class="{% if item.selected %} active{% endif %}{% if item.children %} dropdown-submenu{% endif %}">
5+
<a href="{{ item.url }}">{{ item.title }}</a>
56
{% if item.children %}
67
{% with items=item.children template_name='bootstrap-navbar-submenu.html' %}
78
{% include template_name %}
89
{% endwith %}
910
{% endif %}
10-
</a>
11+
</li>
1112
{% endif %}
1213
{% endfor %}
13-
</div>
14+
</ul>

menu/templates/bootstrap-navbar.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<li class="divider-vertical"></li>
55
{% endif %}
66

7-
<li class="nav-item {% if item.selected %} active{% endif %}{% if item.children %} dropdown{% endif %}" id="top-menu-{{ item.slug }}">
8-
<a href="{{ item.url }}" {% if not item.children %}class=nav-link {% endif%} {% if item.children %} class="nav-link dropdown-toggle" data-hover="dropdown" data-toggle="dropdown"{% endif %}>
7+
<li class="{% if item.selected %} active{% endif %}{% if item.children %} dropdown{% endif %}" id="top-menu-{{ item.slug }}">
8+
<a href="{{ item.url }}"{% if item.children %} class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown"{% endif %}>
99
{% if item.icon %}
1010
<i class="icon-{{ item.icon }} icon-white"></i>&nbsp;
1111
{% endif %}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
2+
{% for item in items %}
3+
{% if item.visible %}
4+
<a class="dropdown-item {% if item.selected %} active{% endif %}{% if item.children %} dropdown-submenu{% endif %}" href="{{ item.url }}">{{ item.title }}
5+
{% if item.children %}
6+
{% with items=item.children template_name='bootstrap-navbar-submenu.html' %}
7+
{% include template_name %}
8+
{% endwith %}
9+
{% endif %}
10+
</a>
11+
{% endif %}
12+
{% endfor %}
13+
</div>

menu/templates/bootstrap4-navbar.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{% for item in menu %}
2+
{% if item.visible %}
3+
{% if item.separator %}
4+
<li class="divider-vertical"></li>
5+
{% endif %}
6+
7+
<li class="nav-item {% if item.selected %} active{% endif %}{% if item.children %} dropdown{% endif %}" id="top-menu-{{ item.slug }}">
8+
<a href="{{ item.url }}" {% if not item.children %}class=nav-link {% endif%} {% if item.children %} class="nav-link dropdown-toggle" data-hover="dropdown" data-toggle="dropdown"{% endif %}>
9+
{% if item.icon %}
10+
<i class="icon-{{ item.icon }} icon-white"></i>&nbsp;
11+
{% endif %}
12+
<span>{{ item.title }}</span>
13+
{% if item.children %}
14+
&nbsp;<b class="caret"></b>
15+
{% endif %}
16+
</a>
17+
{% if item.children %}
18+
{% include 'bootstrap4-navbar-submenu.html' with items=item.children %}
19+
{% endif %}
20+
</li>
21+
{% endif %}
22+
{% endfor %}

0 commit comments

Comments
 (0)