Wiki source code of Navigation

Version 1.1 by Benjamin Fischer on 2024/10/24 11:32

Show last authors
1 {{velocity}}
2 #set ($depth = 3)
3 #set ($limit = 10)
4 #macro (navItem $rootName $level)
5 #set ($rootDoc = $xwiki.getDocument($rootName))
6 #set ($canView = $rootDoc.hasAccess("view"))
7 #if ($canView)
8 $stringtool.repeat('*', $level) {{html}}<a href="$rootDoc.getURL()">$escapetool.xml($rootDoc.plainTitle)</a>{{/html}}
9 #if ($level < $depth)
10 #foreach ($child in $rootDoc.getChildren($limit, 0))
11 #navItem ($child $mathtool.add($level, 1))
12 #end
13 #end
14 #end
15 #end
16
17 * [[{{displayIcon name="home"/}} Home>>Main.WebHome]]
18 * ----
19 * [[{{displayIcon name="book"/}} Material collection>>Material collection.WebHome]]
20 * [[{{displayIcon name="address-book"/}} People in ErUM>>People in ErUM.WebHome]]
21 * ----
22 #navItem ("DIG-UM.WebHome", 1)
23 #navItem ("Internal.WebHome", 1)
24 #if ($hasEdit)
25 * ----
26 * {{displayIcon name="question"/}} Help
27 ** [[XWiki Syntax Guide>>XWiki.XWikiSyntax]]
28 ** [[{{displayIcon name="font-awesome"/}} FontAwesome Icons>>https://fontawesome.com/v4/icons/]]
29 #end
30 {{/velocity}}