Wiki source code of Navigation

Version 2.4 by Benjamin Fischer on 2024/10/24 11:36

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 * [[{{displayIcon name="home"/}} Home>>Main.WebHome]]
17 * ----
18 * [[{{displayIcon name="book"/}} Material collection>>Material collection.WebHome]]
19 * [[{{displayIcon name="address-book"/}} People in ErUM>>People in ErUM.WebHome]]
20 * ----
21 #navItem ("DIG-UM.WebHome", 1)
22 #navItem ("Internal.WebHome", 1)
23 #if ($hasEdit)
24 * ----
25 * {{displayIcon name="question"/}} Help
26 ** [[XWiki Syntax Guide>>XWiki.XWikiSyntax]]
27 ** [[{{displayIcon name="font-awesome"/}} FontAwesome Icons>>https://fontawesome.com/v4/icons/]]
28 #end
29 {{/velocity}}