Last modified by mgrawunder on 2025/10/07 08:48

edited by Pascal Meyer
on 2025/07/30 05:27
Change comment: There is no comment for this version
edited by Pascal Meyer
on 2025/07/30 05:24
Change comment: There is no comment for this version

Summary

Details

insert_drive_file Page properties
Content
... ... @@ -41,15 +41,19 @@
41 41   "Scrum"
42 42  ])
43 43  
44 -## Suche alle Seiten, die ein Child von Main.WebHome sind:
45 -#set ($query = "select doc.fullName from XWikiDocument as doc where doc.parentId = (select id from XWikiDocument where fullName='Main.WebHome')")
44 +#foreach ($childName in $doc.getChildren())
45 + ## childName ist z.B. "Main.Organisatorisches.WebHome"
46 + ## wir entfernen ".WebHome" am Ende:
47 + #set ($docName = "")
48 + #if ($childName.endsWith(".WebHome"))
49 + #set ($docName = $childName.substring(0, $childName.length() - 8))
50 + #else
51 + #set ($docName = $childName)
52 + #end
46 46  
47 -#set ($result = $xwiki.query($query))
54 + #set ($childDoc = $xwiki.getDocument($docName))
48 48  
49 -#foreach ($row in $result)
50 - #set ($fullName = $row.get("doc.fullName"))
51 - #set ($childDoc = $xwiki.getDocument($fullName))
52 - #if ($childDoc.exists && $allowedPages.contains($childDoc.name))
56 + #if ($childDoc.exists && $childDoc.space == "Main" && $allowedPages.contains($childDoc.name))
53 53   * [[$childDoc.displayTitle>>$childDoc.fullName]]
54 54   #end
55 55  #end