Changes for page 3D Printing

Last modified by Josh McGee on 2026/01/21 13:23

From version 60.1
edited by Josh McGee
on 2025/11/19 11:02
Change comment: There is no comment for this version
To version 52.1
edited by Josh McGee
on 2025/11/19 10:51
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -20,26 +20,32 @@
20 20   ## Current wiki name
21 21   #set($wikiName = $xcontext.database)
22 22  
23 - ## Build a document reference for Areas.Upstairs."3D Printers".WebHome
23 + ## Build a document reference for Areas.Upstairs."3D Printers"
24 + ## (nested page, NOT WebHome of another space)
24 24   #set($parentRef = $services.model.createDocumentReference(
25 25   $wikiName,
26 - ['Areas', 'Upstairs', '3D Printing'],
27 - 'WebHome'
27 + ['Areas', 'Upstairs'],
28 + '3D Printers'
28 28   ))
29 29  
30 30   ## Get the parent document
31 31   #set($parentDoc = $xwiki.getDocument($parentRef))
32 32  
33 - ## Get its direct children
34 - #set($children = $parentDoc.getChildren())
35 -
36 - #if(!$children || $children.isEmpty())
37 - No subpages found under [[Areas.Upstairs.3D Printers]].
34 + ## Optional sanity check: ensure the parent exists
35 + #if(!$parentDoc.exists())
36 + Parent page not found: $parentRef
38 38   #else
39 - #foreach($childRef in $children)
40 - ## Resolve each child reference to a document
41 - #set($childDoc = $xwiki.getDocument($childRef))
42 - * [[$childDoc.getDisplayTitle()>>$childDoc]]
38 + ## Get its direct children
39 + #set($children = $parentDoc.getChildren())
40 +
41 + #if(!$children || $children.isEmpty())
42 + No subpages found under 3D Printers.
43 + #else
44 + #foreach($childRef in $children)
45 + ## Resolve each child reference to a document
46 + #set($childDoc = $xwiki.getDocument($childRef))
47 + * [[$childDoc.getDisplayTitle()>>$childDoc]]
48 + #end
43 43   #end
44 44   #end
45 45  #end