-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path_wvu-nav-dropdowns.html
executable file
·30 lines (26 loc) · 1.25 KB
/
_wvu-nav-dropdowns.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
<r:comment>
<!-- NOTE: The max_depth/nav_depth must be 2 or less. -->
</r:comment>
<r:set_var name="nav_depth" value="{$nav_depth}" default="1" />
<nav class="wvu-nav <r:var name="wvu-nav__classes" />">
<div class="wvu-nav__container">
<button id="nav-toggle" class="wvu-nav__button nav-toggle">
<img class="wvu-nav__menu-icon" src="https://static.wvu.edu/global/images/icons/wvu/hamburger-menu--1.0.0.svg" alt="" />
Open Menu
</button>
<div class="nav-collapse">
<r:comment>
<!-- NOTE: If nav depth is greater than 1, show the dropdown caret (has_children_class) & `+` on mobile (sub_ul_class). -->
</r:comment>
<r:if v1="{$nav_depth}" v2="1" op=">" type="Number">
<r:site_menu max_depth="{$nav_depth}" ul_class="wvu-nav__items menu-items" has_children_class="dropdown" sub_ul_class="sub-menu" />
</r:if>
<r:comment>
<!-- NOTE: If nav depth is equal to 1, do NOT show the dropdown caret (has_children_class). -->
</r:comment>
<r:if v1="{$nav_depth}" v2="1" op="=" type="Number">
<r:site_menu max_depth="{$nav_depth}" ul_class="wvu-nav__items menu-items" />
</r:if>
</div> <!-- /.nav-collapse -->
</div> <!-- /.wvu-nav__container -->
</nav> <!-- /.wvu-nav -->