aboutsummaryrefslogtreecommitdiffstats
path: root/templates/web/base/main_nav.html
blob: 1896309021554e593797237dbfb310da03d656d4 (plain)
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
[%
    # DEFAULT would make sense here, except it treats the empty string as falsy
    # and some cobrands want to set ul_class to an empty string.
    SET ul_class="nav-menu nav-menu--main" UNLESS ul_class.defined;
%]
[% BLOCK navitem ~%]
    <li [% liattrs %]>
      [%~ IF c.req.uri.path == uri AND NOT always_url ~%]
          <span [% attrs %]>[% label %]</span>
      [%~ ELSE ~%]
          <a href="[% uri %][% suffix IF suffix %]" [% attrs %]>[% label %]</a>
      [%~ END ~%]
    </li>
[%~ END %]

[% UNLESS omit_wrapper %]
    <div id="main-nav" role="navigation">
[% END %]

    <ul class="[% ul_class %]"[% " id='" _ ul_id _ "'" IF ul_id %]>
        [% INCLUDE 'main_nav_items.html' %]
    </ul>

[% UNLESS omit_wrapper %]
    </div>
[% END %]