Changes for page Navigation

Last modified by Benjamin Fischer on 2025/06/03 16:18

From version 20.1
edited by Benjamin Fischer
on 2024/12/09 15:31
Change comment: There is no comment for this version
To version 23.8
edited by Benjamin Fischer
on 2025/06/03 16:17
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=15 $childsMin=1 $level=1)
3 +#macro (navItem $rootName $depth=4 $childsMax=10 $childsMin=1 $level=1)
4 4   #set ($rootDoc = $xwiki.getDocument($rootName))
5 5   #set ($canView = $rootDoc.hasAccess("view"))
6 6   #if ($canView)
... ... @@ -7,16 +7,22 @@
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, $nChilds), $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, $depth, $mathtool.sub($childsMax, 3), $childsMin, $mathtool.add($level, 1))#end</ul>#end</li>
11 11   #end
12 12  #end
13 13  * [[{{icon name="home"/}}Home>>Main.WebHome]]
14 14  * ----
15 15  * [[{{icon name="book"/}}Material collection>>Material collection.WebHome]]
16 -* [[{{icon name="address-book"/}}People in ErUM-Data>>People in ErUM-Data.WebHome]]
16 +* [[{{icon name="university"/}}People in ErUM-Data>>People in ErUM-Data.WebHome]]
17 +* [[{{icon name="industry"/}}Industry meets ErUM-Data>>Industry meets ErUM-Data.WebHome]]
18 +* [[{{icon name="briefcase"/}}Jobs in ErUM-Data>>Jobs in ErUM-Data.WebHome]]
17 17  <li><br/></li>
18 18  #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 +</ul></li>
19 19  #navItem ("Internal.WebHome")
25 +<li>[[ErUM-Data Call 2025.WebHome]]</li>
20 20  #if ($hasEdit)
21 21  <li><br/></li>
22 22  <li class="open">{{icon name="question"/}} Help<ul>
XWiki.StyleSheetExtension[0]
Code
... ... @@ -1,4 +1,18 @@
1 1  .panel .menu.menu-vertical {
2 + > ul {
3 + > li > *:first-child {
4 + font-weight: bold;
5 + }
6 + ul {
7 + list-style-type: disc;
8 + ul {
9 + list-style-type: circle;
10 + ul {
11 + list-style-type: square;
12 + }
13 + }
14 + }
15 + }
2 2   li {
3 3   padding: 0.05em;
4 4   }
XWiki.JavaScriptExtension[0]
Caching policy
... ... @@ -1,0 +1,1 @@
1 +default
Code
... ... @@ -1,0 +1,19 @@
1 +document.addEventListener("load", () => {
2 + for (let e = document.querySelector(`#leftPanels a[href="${location.pathname.replace(/^(\/bin\/)[^\/]+(\/.+)/, "$1view$2")}"]`); e; e = e.parentElement)
3 + for(const c of e.classList)
4 + switch(c) {
5 + case "xDropdown":
6 + e.classList.add("open");
7 + break;
8 + case "wikilink":
9 + e.style.textDecoration = "underline";
10 + break;
11 + case "xDropdown-menu":
12 + const s = e.previousElementSibling?.firstElementChild?.style;
13 + if (s) s.textDecoration = "underline";
14 + break;
15 + case "panels":
16 + return;
17 + }
18 +});
19 +
Name
... ... @@ -1,0 +1,1 @@
1 +Current Page Integration
Parse content
... ... @@ -1,0 +1,1 @@
1 +No
Use this extension
... ... @@ -1,0 +1,1 @@
1 +currentPage