From 245928a1ff49c6a1c25524f08bf538b0ab88f1a8 Mon Sep 17 00:00:00 2001 From: Bjørn Erik Pedersen Date: Wed, 29 May 2024 13:23:36 +0200 Subject: content adapter: Add support for menus in AddPage Fixes #12507 --- navigation/pagemenus.go | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'navigation') diff --git a/navigation/pagemenus.go b/navigation/pagemenus.go index 3ff49cf81..0919d93bb 100644 --- a/navigation/pagemenus.go +++ b/navigation/pagemenus.go @@ -41,20 +41,11 @@ type MenuQueryProvider interface { IsMenuCurrent(menuID string, inme *MenuEntry) bool } -func PageMenusFromPage(p Page) (PageMenus, error) { - params := p.Params() - - ms, ok := params["menus"] - if !ok { - ms, ok = params["menu"] - } - - pm := PageMenus{} - - if !ok { +func PageMenusFromPage(ms any, p Page) (PageMenus, error) { + if ms == nil { return nil, nil } - + pm := PageMenus{} me := MenuEntry{} SetPageValues(&me, p) -- cgit v1.2.3