Skip to content

Commit ee3c83d

Browse files
committed
chore: Use split button for menu dropdown
1 parent db3d05b commit ee3c83d

File tree

1 file changed

+8
-9
lines changed
  • djangocms_frontend/templates/bootstrap5

1 file changed

+8
-9
lines changed
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
{% load i18n menu_tags cache %}{% spaceless %}
22
{% for child in children %}
3-
<li class="nav-item text-center {% if child.ancestor %}ancestor{% endif %}{% if child.children %} dropdown{% endif %}">
4-
{% if child.children %}<a class="nav-link dropdown-toggle{% if child.selected %} active{% endif %}" role="button" data-bs-toggle="dropdown" data-request="{{ request.path }}" href="{{ child.get_absolute_url }}" id="menu-{{ child.id|safe }}">{{ child.get_menu_title }}</a>
5-
<div class="dropdown-menu" aria-labelledby="menu-{{ child.ancestor.id|safe }}">
6-
{% show_menu from_level to_level extra_inactive extra_active "bootstrap5/dropdown.html" "" "" child %}
7-
</div>
8-
{% else %}
9-
<a class="nav-link{% if child.selected %} active{% endif %}" href="{{ child.get_absolute_url }}"><span>{{ child.get_menu_title }}</span></a>
10-
{% endif %}
11-
</li>
3+
<li class="btn-group {% if child.ancestor %}ancestor{% endif %}{% if child.children %} dropdown{% endif %}">
4+
<a class="nav-link{% if child.selected %} active{% endif %}" data-request="{{ request.path }}" id="menu-{{ child.id|safe }}" href="{{ child.get_absolute_url }}">{{ child.get_menu_title }}</a>
5+
{% if child.children %}<button class="nav-link btn-secondary btn-sm dropdown-toggle" style="padding-left: 0;" data-bs-toggle="dropdown" aria-expanded="false" data-bs-reference="parent"></button>
6+
<div class="dropdown-menu" aria-labelledby="menu-{{ child.ancestor.id|safe }}">
7+
{% show_menu from_level to_level extra_inactive extra_active "bootstrap5/dropdown.html" "" "" child %}
8+
</div>
9+
{% endif %}
10+
</li>
1211
{% endfor %}
1312
{% endspaceless %}

0 commit comments

Comments
 (0)