summaryrefslogtreecommitdiff
path: root/layouts/partials/menu/item.html
blob: f000b2c7fbc492d21819af3375be34a76ca88f0f (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{{- $page := .page }}
{{- $item := .item }}
{{- $pageItem := $page.GetPage $item.URL }}

{{- if $pageItem.Params.menu_item_override }}

  {{- if $pageItem.Params.menu_item_override_start_li }}<li>{{- end}}

  {{$item.Pre}}<a href="{{ $item.URL }}">{{ $pageItem.Params.menu_item_override }}</a>{{- partial "menu/new-or-up.html" (dict "page" $pageItem) }}{{$item.Post}}

  {{- if $pageItem.Params.menu_item_override_end_li }}</li>{{- end}}

{{- else}}

<li>
  {{- if $item.Params.nonpage }}
   {{ $item.Pre}} {{$item.Name }} {{ $item.Post }}
  {{- else if $item.Params.placeholder }}
     <span class="placeholder">{{ $item.Pre }}{{$item.Name }}{{ $item.Post }}</span>
  {{- else}}
     {{$item.Pre}} 
       <a
         {{ if $item.Params.forcedId }}id="{{ $item.Params.forcedId }}"{{ end }}
         href="{{ $item.URL }}">{{ $item.Name }}</a>

    {{- partial "menu/new-or-up.html" (dict "page" $pageItem) }}
    {{ $item.Post }} 
  {{- end}}

           
  {{- if $item.Params.inlineChildren}}
    {{- with $item.Children }}
    - {{- partial "inline/menu/inline.html" (dict "page" $page "menuEntries" .) }}
    {{- end}}

  {{- else}}
    {{- with $item.Children }}
      <ul>{{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}</ul>
    {{- end }}
  {{- end}}


</li>

{{- end}}