Skip to content

Commit

Permalink
Merge pull request #110 from MerlinB/expanded-menu
Browse files Browse the repository at this point in the history
Expand main menu
  • Loading branch information
Merlin authored and GitHub committed Sep 2, 2019
2 parents 9f765ce + e1b2bfa commit 9a20f50
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions mpicms/templates/menus/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
<div class="navbar-menu" id="navMenu" style="flex-shrink: 1">
<div class="navbar-start" style="flex-wrap: wrap;">
{% for item in request.site.root_page.get_children.live.in_menu %}
{% with item.get_children.live.in_menu as children %}
{% if children %}
{% with item.get_children.live.in_menu as parents %}
{% if parents %}
<div class="navbar-item has-dropdown is-hoverable">
<a href="{% pageurl item %}" class="navbar-link navbar-title is-hidden-touch">
{{ item }}
Expand All @@ -78,10 +78,22 @@
</a>

<div class="navbar-dropdown is-hidden-touch is-boxed">
{% for child in children %}
<a href="{% pageurl child %}" class="navbar-item">
{{ child }}
{% for parent in parents %}
<a href="{% pageurl parent %}" class="navbar-item">
<b>{{ parent }}</b>
</a>
{% with parent.get_children.live.in_menu as children %}
{% if children %}
{% for child in children %}
<a href="{% pageurl child %}" class="navbar-item">
{{ child }}
</a>
{% endfor %}
{% endif %}
{% endwith %}
{% if not forloop.last %}
<hr class="dropdown-divider">
{% endif %}
{% endfor %}
</div>
</div>
Expand Down

0 comments on commit 9a20f50

Please sign in to comment.