Changes for page Navigation

Last modified by Benjamin Fischer on 2025/08/29 12:00

From version 23.10
edited by Benjamin Fischer
on 2025/06/17 15:52
Change comment: There is no comment for this version
To version 25.1
edited by Benjamin Fischer
on 2025/08/29 12:00
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,6 +1,6 @@
1 1  {{velocity}}
2 2  {{html wiki="true"}}
3 -#macro (navItem $rootName $depth=4 $childsMax=10 $childsMin=1 $level=1)
3 +#macro (navItem $rootName $childsMin=1 $childsMax=10 $depth=4 $level=1)
4 4   #set ($rootDoc = $xwiki.getDocument($rootName))
5 5   #set ($canView = $rootDoc.hasAccess("view"))
6 6   #if ($canView)
... ... @@ -7,7 +7,7 @@
7 7   #set ($children = $rootDoc.getChildren())
8 8   #set ($nChilds = $children.size())
9 9   #set ($hasChilds = (($level < $depth) && ($nChilds > 0)))
10 - <li#if($childsMin < $nChilds && $nChilds < $childsMax) class="open"#end>#if($rootDoc.getContent().isEmpty()&&$hasChilds) $rootDoc.plainTitle #else [[$rootDoc.plainTitle>>$rootDoc.fullName]] #end#if($hasChilds)<ul>#foreach($child in $children)#navItem ($child, $depth, $mathtool.sub($childsMax, 3), $childsMin, $mathtool.add($level, 1))#end</ul>#end</li>
10 + <li#if($childsMin < $nChilds && $nChilds < $childsMax) class="open"#end>#if($rootDoc.getContent().isEmpty()&&$hasChilds) $rootDoc.plainTitle #else [[$rootDoc.plainTitle>>$rootDoc.fullName]] #end#if($hasChilds)<ul>#foreach($child in $children)#navItem ($child, $childsMin, $mathtool.sub($childsMax, 3), $depth, $mathtool.add($level, 1))#end</ul>#end</li>
11 11   #end
12 12  #end
13 13  * [[{{icon name="home"/}}Home>>Main.WebHome]]
... ... @@ -18,10 +18,8 @@
18 18  * [[{{icon name="briefcase"/}}Jobs in ErUM-Data>>Jobs in ErUM-Data.WebHome]]
19 19  <li><br/></li>
20 20  #navItem ("DIG-UM.WebHome")
21 -<li class="open">[[Program Planning.WebHome]]<ul>
22 - <li>[[2nd Workshop on Sustainability>>MoccaCalendar.Workshops.2nd Workshop on Sustainability in the Digital Transformation of Basic Research on Universe & Matter.Program Planning.WebHome]]</li>
23 - <li>[[2nd Transfer Workshop>>MoccaCalendar.Workshops.2nd Workshop on Sustainability in the Digital Transformation of Basic Research on Universe & Matter.Program Planning.2nd Transfer Workshop (Hamburg 2026).WebHome]]</li>
24 -</ul></li>
21 +#navItem ("Action Group.WebHome" 0)
22 +#navItem ("Program Planning.WebHome" 0)
25 25  #navItem ("Internal.WebHome")
26 26  <li>[[ErUM-Data Call 2025.WebHome]]</li>
27 27  #if ($hasEdit)