Changes for page Rangee Index

Last modified by Tobias Wintrich on 2025/06/04 09:20

From version 10.91
edited by Tobias Wintrich
on 2021/09/28 10:04
Change comment: There is no comment for this version
To version 12.31
edited by Tobias Wintrich
on 2021/09/28 12:01
Change comment: There is no comment for this version

Summary

Details

XWiki.WikiMacroClass[0]
Context elements
... ... @@ -1,0 +1,1 @@
1 +Sprache
Macro code
... ... @@ -1,15 +1,28 @@
1 1  {{velocity}}
2 -{{tree links="true" edges="false"}}
2 +##{{tree links="true" edges="false"}}
3 +#set($depth = $wikimacro.parameters.depth)
4 +#if ($xcontext.locale == 'de')
5 + #set($locale = '')
6 +#else
7 + #set($locale = $xcontext.locale)
8 +#end
3 3  {{html wiki=true}}
10 +language $locale
4 4  <ul>
5 5   #set($results = false)
6 6   #set ($query = $services.query.xwql('where doc.parent = :doc and doc.hidden = 0 order by doc.title asc'))
7 - #set($results = $query.bindValue('doc', $doc.fullName).addFilter('currentlanguage').execute())
14 + #set($results = $query.bindValue('doc', $doc.fullName).addFilter('currentlanguage').execute())
8 8   #foreach($docname in $results)
9 9   #set($rdoc = $xwiki.getDocument($docname).getTranslatedDocument())
10 - <li class="jstree-open">
11 - [[$rdoc.getDisplayTitle()>>$rdoc.fullName]]
12 - </li>
17 + #if ($locale == $rdoc.getLanguage())
18 + <li class="
19 + #if ($depth > 0)
20 + jstree-open
21 + #end
22 + ">
23 + [[$rdoc.getDisplayTitle()>>$rdoc.fullName]]
24 + </li>
25 + #end
13 13   #set($results2 = false)
14 14   #set($query2 = $services.query.xwql('where doc.parent=:doc and doc.hidden = 0 order by doc.title asc'))
15 15   #set($results2 = $query2.bindValue('doc', $docname).addFilter('currentlanguage').execute())
... ... @@ -16,7 +16,11 @@
16 16   <ul>
17 17   #foreach($rdoc in $results2)
18 18   #set($rdoc2 = $xwiki.getDocument($rdoc).getTranslatedDocument())
19 - <li class="jstree-open">
32 + <li class="$rdoc.getLanguage()
33 + #if ($depth > 1)
34 + jstree-open
35 + #end
36 + ">
20 20   [[$rdoc2.getDisplayTitle()>>$rdoc2.fullName]]
21 21   </li>
22 22   #set($results3 = false)
... ... @@ -25,7 +25,11 @@
25 25   <ul>
26 26   #foreach($rdoc2 in $results3)
27 27   #set($rdoc3 = $xwiki.getDocument($rdoc2).getTranslatedDocument())
28 - <li class="jstree-open">
45 + <li class="
46 + #if ($depth > 2)
47 + jstree-open
48 + #end
49 + ">
29 29   [[$rdoc3.getDisplayTitle()>>$rdoc3.fullName]]
30 30   </li>
31 31   #set($results4 = false)
... ... @@ -34,7 +34,11 @@
34 34   <ul>
35 35   #foreach($rdoc3 in $results4)
36 36   #set($rdoc4 = $xwiki.getDocument($rdoc3).getTranslatedDocument())
37 - <li class="jstree-open">
58 + <li class="
59 + #if ($depth > 3)
60 + jstree-open
61 + #end
62 + ">
38 38   [[$rdoc4.getDisplayTitle()>>$rdoc4.fullName]]
39 39   </li>
40 40   #set($results5 = false)
... ... @@ -43,7 +43,11 @@
43 43   <ul>
44 44   #foreach($rdoc4 in $results5)
45 45   #set($rdoc5 = $xwiki.getDocument($rdoc4).getTranslatedDocument())
46 - <li class="jstree-open">
71 + <li class="
72 + #if ($depth > 4)
73 + jstree-open
74 + #end
75 + ">
47 47   [[$rdoc5.getDisplayTitle()>>$rdoc5.fullName]]
48 48   </li>
49 49   #end
... ... @@ -58,5 +58,5 @@
58 58  </ul>
59 59  
60 60  {{/html}}
61 -{{/tree}}
90 +##{{/tree}}
62 62  {{/velocity}}
XWiki.WikiMacroParameterClass[0]
Parameter default value
... ... @@ -1,1 +1,1 @@
1 -100
1 +5
Parameter description
... ... @@ -1,1 +1,1 @@
1 -Öffne bis Ebene
1 +Öffne bis Ebene (0-5)