Changes for page Rangee Index
Last modified by Tobias Wintrich on 2025/10/31 08:26
From version 20.2
edited by Tobias Wintrich
on 2025/10/15 08:13
on 2025/10/15 08:13
Change comment:
There is no comment for this version
To version 20.5
edited by Tobias Wintrich
on 2025/10/15 08:15
on 2025/10/15 08:15
Change comment:
There is no comment for this version
Summary
-
Objects (1 modified, 0 added, 0 removed)
Details
- XWiki.WikiMacroClass[0]
-
- Macro code
-
... ... @@ -1,6 +1,8 @@ 1 1 {{velocity}} 2 2 {{tree links="true" edges="false"}} 3 3 #set($depth = $wikimacro.parameters.depth) 4 + 5 +## Locale bestimmen 4 4 #set($locale = '') 5 5 #if ($xcontext.locale != 'de') 6 6 #set($locale = $xcontext.locale) ... ... @@ -12,21 +12,18 @@ 12 12 #set($translatedDoc = $doc.getTranslatedDocument()) 13 13 14 14 ## Nur rendern wenn Sprache passt 15 - #if ($locale == '' ||$locale == $translatedDoc.getLanguage())17 + #if ($locale == $translatedDoc.getLanguage()) 16 16 #set($cssClass = '') 17 - 18 - ## Kinder-Dokumente abfragen - OHNE currentlanguage Filter 19 - #set($childQuery = $services.query.xwql('where doc.parent = :parentDoc and doc.hidden = 0 order by doc.title asc')) 20 - #set($children = $childQuery.bindValue('parentDoc', $docFullName).execute()) 21 - 22 - ## CSS-Klasse nur wenn Kinder existieren UND Tiefe noch nicht erreicht 23 - #if ($children && $children.size() > 0 && $currentDepth < $depth) 19 + #if ($currentDepth < $depth) 24 24 #set($cssClass = 'jstree-open') 25 25 #end 26 - 27 27 <li class="$cssClass"> 28 28 [[$translatedDoc.getDisplayTitle()>>$translatedDoc.fullName]] 29 29 25 + ## Kinder-Dokumente abfragen 26 + #set($childQuery = $services.query.xwql('where doc.parent = :parentDoc and doc.hidden = 0 order by doc.title asc')) 27 + #set($children = $childQuery.bindValue('parentDoc', $docFullName).addFilter('currentlanguage').execute()) 28 + 30 30 ## Rekursiv rendern wenn Kinder vorhanden sind 31 31 #if ($children && $children.size() > 0 && $currentDepth < $depth) 32 32 #set($nextDepth = $currentDepth + 1) ... ... @@ -42,9 +42,9 @@ 42 42 43 43 {{html wiki=true}} 44 44 <ul> 45 - ## Root-Dokumente laden - OHNE currentlanguage Filter44 + ## Root-Dokumente laden 46 46 #set($rootQuery = $services.query.xwql('where doc.parent = :doc and doc.hidden = 0 order by doc.title asc')) 47 - #set($rootDocs = $rootQuery.bindValue('doc', $doc.fullName).execute()) 46 + #set($rootDocs = $rootQuery.bindValue('doc', $doc.fullName).addFilter('currentlanguage').execute()) 48 48 49 49 #foreach($docName in $rootDocs) 50 50 #renderTreeNode($docName 1)