Changes for page Rangee Index

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

From version 12.36
edited by Tobias Wintrich
on 2021/09/28 12:19
Change comment: There is no comment for this version
To version 12.41
edited by Tobias Wintrich
on 2021/09/28 12:28
Change comment: There is no comment for this version

Summary

Details

XWiki.WikiMacroClass[0]
Macro code
... ... @@ -1,5 +1,5 @@
1 1  {{velocity}}
2 -##{{tree links="true" edges="false"}}
2 +{{tree links="true" edges="false"}}
3 3  #set($depth = $wikimacro.parameters.depth)
4 4  #if ($xcontext.locale == 'de')
5 5   #set($locale = '')
... ... @@ -7,10 +7,9 @@
7 7   #set($locale = $xcontext.locale)
8 8  #end
9 9  {{html wiki=true}}
10 -language $locale
11 11  <ul>
12 12   #set($results = false)
13 - #set ($query = $services.query.xwql('where doc.parent = :doc and doc.hidden = 0 order by doc.title asc'))
12 + #set ($query = $services.query.xwql('where doc.parent = :doc and doc.hidden = 0 and doc.language="en" order by doc.title asc'))
14 14   #set($results = $query.bindValue('doc', $doc.fullName).addFilter('currentlanguage').execute())
15 15   #foreach($docname in $results)
16 16   #set($rdoc = $xwiki.getDocument($docname).getTranslatedDocument())
... ... @@ -29,15 +29,15 @@
29 29   <ul>
30 30   #foreach($rdoc in $results2)
31 31   #set($rdoc2 = $xwiki.getDocument($rdoc).getTranslatedDocument())
32 - #if ($locale == $rdoc.getLanguage())
31 + #if ($locale == $rdoc2.getLanguage())
33 33   <li class="
34 34   #if ($depth > 1)
35 35   jstree-open
36 36   #end
37 37   ">
38 - #end
39 39   [[$rdoc2.getDisplayTitle()>>$rdoc2.fullName]]
40 40   </li>
39 + #end
41 41   #set($results3 = false)
42 42   #set($query3 = $services.query.xwql('where doc.parent=:doc and doc.hidden = 0 order by doc.title asc'))
43 43   #set($results3 = $query3.bindValue('doc', $rdoc).addFilter('currentlanguage').execute())
... ... @@ -44,6 +44,7 @@
44 44   <ul>
45 45   #foreach($rdoc2 in $results3)
46 46   #set($rdoc3 = $xwiki.getDocument($rdoc2).getTranslatedDocument())
46 + #if ($locale == $rdoc3.getLanguage())
47 47   <li class="
48 48   #if ($depth > 2)
49 49   jstree-open
... ... @@ -51,6 +51,7 @@
51 51   ">
52 52   [[$rdoc3.getDisplayTitle()>>$rdoc3.fullName]]
53 53   </li>
54 + #end
54 54   #set($results4 = false)
55 55   #set($query4 = $services.query.xwql('where doc.parent=:doc and doc.hidden = 0 order by doc.title asc'))
56 56   #set($results4 = $query4.bindValue('doc', $rdoc2).addFilter('currentlanguage').execute())
... ... @@ -57,6 +57,7 @@
57 57   <ul>
58 58   #foreach($rdoc3 in $results4)
59 59   #set($rdoc4 = $xwiki.getDocument($rdoc3).getTranslatedDocument())
61 + #if ($locale == $rdoc4.getLanguage())
60 60   <li class="
61 61   #if ($depth > 3)
62 62   jstree-open
... ... @@ -64,6 +64,7 @@
64 64   ">
65 65   [[$rdoc4.getDisplayTitle()>>$rdoc4.fullName]]
66 66   </li>
69 + #end
67 67   #set($results5 = false)
68 68   #set($query5 = $services.query.xwql('where doc.parent=:doc and doc.hidden = 0 order by doc.title asc'))
69 69   #set($results5 = $query3.bindValue('doc', $rdoc3).addFilter('currentlanguage').execute())
... ... @@ -70,6 +70,7 @@
70 70   <ul>
71 71   #foreach($rdoc4 in $results5)
72 72   #set($rdoc5 = $xwiki.getDocument($rdoc4).getTranslatedDocument())
76 + #if ($locale == $rdoc5.getLanguage())
73 73   <li class="
74 74   #if ($depth > 4)
75 75   jstree-open
... ... @@ -77,6 +77,7 @@
77 77   ">
78 78   [[$rdoc5.getDisplayTitle()>>$rdoc5.fullName]]
79 79   </li>
84 + #end
80 80   #end
81 81   </ul>
82 82   #end
... ... @@ -89,5 +89,5 @@
89 89  </ul>
90 90  
91 91  {{/html}}
92 -##{{/tree}}
97 +{{/tree}}
93 93  {{/velocity}}