From 5a688cc06d4d50401e415555f72642a1bfc28cf9 Mon Sep 17 00:00:00 2001 From: Nikolaos Beer Date: Thu, 17 Nov 2022 13:59:38 +0100 Subject: [PATCH] Check wether a navigator category contains any items or not, closes #11 --- add/data/xql/getNavigatorConfig.xql | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/add/data/xql/getNavigatorConfig.xql b/add/data/xql/getNavigatorConfig.xql index 27aecf35d..c8a700fc6 100644 --- a/add/data/xql/getNavigatorConfig.xql +++ b/add/data/xql/getNavigatorConfig.xql @@ -109,9 +109,7 @@ declare function local:getSeparator() { declare function local:getDefinition($navConfig) { let $elems := $navConfig/* for $elem in $elems - return - if(local-name($elem) eq 'navigatorItem') then( local:getItem($elem, 1) @@ -122,7 +120,12 @@ declare function local:getDefinition($navConfig) { ) else if(local-name($elem) eq 'navigatorCategory') then( - local:getCategory($elem, 1) + (: check if there are any items in category to show, dependig on (RWA) rules defined in local:getDefinition :) + let $category := local:getCategory($elem, 1) + return + if ($category//div[@class="navigatorItem"]) + then ($category) + else () ) else() };