Wiki source code of Navigation

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

Hide last authors
Benjamin Fischer 1.1 1 {{velocity}}
Benjamin Fischer 7.1 2 {{html wiki="true"}}
Benjamin Fischer 25.1 3 #macro (navItem $rootName $childsMin=1 $childsMax=10 $depth=4 $level=1)
Benjamin Fischer 1.1 4 #set ($rootDoc = $xwiki.getDocument($rootName))
5 #set ($canView = $rootDoc.hasAccess("view"))
6 #if ($canView)
Benjamin Fischer 5.1 7 #set ($children = $rootDoc.getChildren())
Benjamin Fischer 9.1 8 #set ($nChilds = $children.size())
Benjamin Fischer 12.1 9 #set ($hasChilds = (($level < $depth) && ($nChilds > 0)))
Benjamin Fischer 25.1 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>
Benjamin Fischer 1.1 11 #end
12 #end
Benjamin Fischer 2.10 13 * [[{{icon name="home"/}}Home>>Main.WebHome]]
Benjamin Fischer 2.4 14 * ----
Benjamin Fischer 2.10 15 * [[{{icon name="book"/}}Material collection>>Material collection.WebHome]]
Benjamin Fischer 23.5 16 * [[{{icon name="university"/}}People in ErUM-Data>>People in ErUM-Data.WebHome]]
Benjamin Fischer 23.4 17 * [[{{icon name="industry"/}}Industry meets ErUM-Data>>Industry meets ErUM-Data.WebHome]]
Benjamin Fischer 23.6 18 * [[{{icon name="briefcase"/}}Jobs in ErUM-Data>>Jobs in ErUM-Data.WebHome]]
Benjamin Fischer 16.1 19 <li><br/></li>
Benjamin Fischer 5.1 20 #navItem ("DIG-UM.WebHome")
Benjamin Fischer 25.1 21 #navItem ("Action Group.WebHome" 0)
22 #navItem ("Program Planning.WebHome" 0)
Benjamin Fischer 5.1 23 #navItem ("Internal.WebHome")
Benjamin Fischer 23.1 24 <li>[[ErUM-Data Call 2025.WebHome]]</li>
Benjamin Fischer 1.1 25 #if ($hasEdit)
Benjamin Fischer 15.2 26 <li><br/></li>
Benjamin Fischer 14.1 27 <li class="open">{{icon name="question"/}} Help<ul>
Benjamin Fischer 15.1 28 <li>[[XWiki Syntax Guide>>XWiki.XWikiSyntax]]</li>
Benjamin Fischer 18.1 29 #if ($isAdvancedUser && $hasProgramming)
30 <li>[[XWiki Scripting API>>https://www.xwiki.org/xwiki/bin/view/ScriptingDocumentation/]]</li>
31 #end
Benjamin Fischer 14.1 32 <li>[[{{icon name="font-awesome"/}}FontAwesome Icons>>https://fontawesome.com/v4/icons/]]</li>
33 </ul></li>
Benjamin Fischer 1.1 34 #end
Benjamin Fischer 7.1 35 {{/html}}
Benjamin Fischer 1.1 36 {{/velocity}}