Wiki source code of Navigation

Version 2.5 by Benjamin Fischer on 2024/10/24 11:40

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 #if ($rootDoc.getContent().isEmpty())
9 $stringtool.repeat('*', $level) $rootDoc.plainTitle
10 #else
11 $stringtool.repeat('*', $level) {{html}}<a href="$rootDoc.getURL()">$escapetool.xml($rootDoc.plainTitle)</a>{{/html}}
12 #end
13 #if ($level < $depth)
14 #foreach ($child in $rootDoc.getChildren($limit, 0))
15 #navItem ($child $mathtool.add($level, 1))
16 #end
17 #end
18 #end
19 #end
20 * [[{{displayIcon name="home"/}} Home>>Main.WebHome]]
21 * ----
22 * [[{{displayIcon name="book"/}} Material collection>>Material collection.WebHome]]
23 * [[{{displayIcon name="address-book"/}} People in ErUM>>People in ErUM.WebHome]]
24 * ----
25 #navItem ("DIG-UM.WebHome", 1)
26 #navItem ("Internal.WebHome", 1)
27 #if ($hasEdit)
28 * ----
29 * {{displayIcon name="question"/}} Help
30 ** [[XWiki Syntax Guide>>XWiki.XWikiSyntax]]
31 ** [[{{displayIcon name="font-awesome"/}} FontAwesome Icons>>https://fontawesome.com/v4/icons/]]
32 #end
33 {{/velocity}}