updated nested menu template to correctly render product tags in v2
parent
2e6e1b6027
commit
b86c16766e
|
@ -1,6 +1,6 @@
|
|||
{{ $isV2 := cond (in .RelPermalink "/v2.") true false }}
|
||||
{{ $page := .page }}
|
||||
{{ $menu := .menu }}
|
||||
{{ $isV2 := cond (in $page.RelPermalink "/v2.") true false }}
|
||||
|
||||
{{ define "productTag" }}
|
||||
{{ if and (.Page.Params.products) (not .Page.Parent.Params.products) }}{{ range .Page.Params.products }}<span class="{{ . }}"></span>{{ end }}{{ end }}
|
||||
|
@ -9,7 +9,7 @@
|
|||
{{ range $menu }}
|
||||
<li class="nav-category {{ if eq $page.RelPermalink .URL }}active{{end}}">
|
||||
{{ if .HasChildren }}<a href="#" class="children-toggle {{ if or ($page.IsMenuCurrent .Menu .) ($page.HasMenuCurrent .Menu .) }}open{{end}}"></a>{{ end }}
|
||||
<a href="{{ .URL }}">{{ .Name }} {{ if $isV2 }}{{ template "productTag" . }}{{ end }}</a>
|
||||
<a href="{{ .URL }}">{{ .Name }} {{ $isV2 }}{{ if $isV2 }}{{ template "productTag" . }}{{ end }}</a>
|
||||
{{ if .HasChildren }}
|
||||
<ul class="children {{ if or ($page.IsMenuCurrent .Menu .) ($page.HasMenuCurrent .Menu .) }}open{{end}}">
|
||||
{{ range .Children }}
|
||||
|
|
Loading…
Reference in New Issue