From 099d1dc5a2de1323e0550973bf9ce248c8fb84fa Mon Sep 17 00:00:00 2001 From: alexisben <alex@noesya.coop> Date: Tue, 16 Jan 2024 16:30:32 +0100 Subject: [PATCH] check items menu presence --- layouts/partials/header/header.html | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/layouts/partials/header/header.html b/layouts/partials/header/header.html index f0ab7dce..e92304f4 100644 --- a/layouts/partials/header/header.html +++ b/layouts/partials/header/header.html @@ -1,18 +1,21 @@ -{{ $context := . }} +{{ $primary := partial "GetMenu" "primary" }} + <header id="document-header"> <nav aria-label="{{ i18n "commons.menu.main" }}"> <div class="container"> {{ partial "header/logo.html" }} - {{ partial "header/button.html" }} - <div class="menu" id="navigation"> - {{ partial "commons/menu.html" - (dict - "kind" "primary" - "dropdown" true - "level" 1 - "context" . - ) }} - </div> + {{ if $primary.items }} + {{ partial "header/button.html" }} + <div class="menu" id="navigation"> + {{ partial "commons/menu.html" + (dict + "kind" "primary" + "dropdown" true + "level" 1 + "context" . + ) }} + </div> + {{ end }} </div> </nav> </header> -- GitLab