-
Notifications
You must be signed in to change notification settings - Fork 16
/
header-secondary-navigation.html
30 lines (26 loc) · 1.18 KB
/
header-secondary-navigation.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{% set selected_nav = data.nav.entries|selectattr("id", "equalto", section_id)|first %}
{% set extraClasses = "" %}
{% if mobile %}
{% set extraClasses = "secondary-nav__item_mobile" %}
{% endif %}
<li class="dropdown {{ extraClasses }}" role="menuitem">
<a href="#" class="dropdown__trigger nav-bar__link" data-toggle="dropdown" id="menu-{{ selected_nav.id }}" role="button" aria-haspopup="true" aria-expanded="false" role="menuitem">
{{ selected_nav.label }}
<span data-feather="chevron-down" aria-hidden="true"></span>
</a>
<ul class="dropdown__menu" aria-labelledby="menu-{{ selected_nav.id }}" aria-label="{{ selected_nav.label }}" role="menu">
{% for entry in selected_nav.entries %}
{% set url = entry.url %}
{% set urlAttrs = 'rel="noopener" target="_blank"' %}
{% if entry.route %}
{% set url = url_for(entry.route) %}
{% set urlAttrs = "" %}
{% endif %}
<li>
<a {{ urlAttrs }} href="{{ url }}" class="dropdown__link" role="menuitem">
{{ entry.label }}
</a>
</li>
{% endfor %}
</ul>
</li>