diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html
index 70b6ca7f9..2f8d41a74 100644
--- a/layouts/partials/sidebar.html
+++ b/layouts/partials/sidebar.html
@@ -25,11 +25,11 @@
{{ $refMenu := (index .Site.Menus (print (replaceRE "[.]" "_" $currentVersion) "_ref")) }}
- {{ partial "sidebar/nested-menu" (dict "page" $currentPage "menu" $mainMenu) }}
+ {{ partial "sidebar/nested-menu" (dict "page" $currentPage "menu" $mainMenu) . }}
Reference
- {{ partial "sidebar/nested-menu" (dict "page" $currentPage "menu" $refMenu) }}
+ {{ partial "sidebar/nested-menu" (dict "page" $currentPage "menu" $refMenu) . }}
diff --git a/layouts/partials/sidebar/nested-menu.html b/layouts/partials/sidebar/nested-menu.html
index 866fc74da..2cc4b7d08 100644
--- a/layouts/partials/sidebar/nested-menu.html
+++ b/layouts/partials/sidebar/nested-menu.html
@@ -1,40 +1,44 @@
{{ $page := .page }}
{{ $menu := .menu }}
+{{ define "productTag" }}
+ {{ if and (.Page.Params.products) (not .Page.Parent.Params.products) }}{{ range .Page.Params.products }}{{ end }}{{ end }}
+{{ end }}
+
{{ range $menu }}
{{ if .HasChildren }}{{ end }}
- {{ .Name }} {{ if .Page.Params.products }}{{ range .Page.Params.products }}{{ end }}{{ end }}
+ {{ .Name }} {{ template "productTag" . }}
{{ if .HasChildren }}