aboutsummaryrefslogtreecommitdiffstats
path: root/templates/web/base/main_nav.html
blob: 9736697e3fbf9884d2246b5435dd2112b9a8c25c (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
27
28
29
[%
    SET base = "";
    SET base = c.cobrand.base_url IF admin;

    # 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="[% base %][% 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 %]