Changes for page Home

Last modified by Isaac Mejia on 2025/12/15 18:27

From version 10.1
edited by Isaac Mejia
on 2025/12/05 16:57
Change comment: There is no comment for this version
To version 9.1
edited by Isaac Mejia
on 2025/12/05 16:52
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -4,16 +4,14 @@
4 4  ## ------------------------------------------------------------
5 5  ## 1) Discover category pages automatically
6 6  ## - Category pages live at: Main.<CategoryLabel>.WebHome
7 -## - We query all docs in space=Main except:
8 -## - WebHome
9 -## - KB-Categories (index page)
10 -## - KBStyles (internal style doc, not a category)
7 +## - We query all docs in space=Main except WebHome + KB-Categories
11 11  ## ------------------------------------------------------------
12 12  #set ($xwql =
13 13   "select doc.fullName, doc.title " +
14 14   "from XWikiDocument doc " +
15 15   "where doc.space = :space " +
16 - "and doc.name not in ('WebHome','KB-Categories','KBStyles') " +
13 + "and doc.name <> 'WebHome' " +
14 + "and doc.name <> 'KB-Categories' " +
17 17   "and doc.hidden <> true " +
18 18   "order by lower(doc.title)"
19 19  )
... ... @@ -21,14 +21,18 @@
21 21  #set ($query = $services.query.xwql($xwql).bindValue("space", "Main"))
22 22  #set ($rows = $query.execute())
23 23  
22 +## Build a list of document objects for convenience
24 24  #set ($categories = [])
25 25  #foreach ($row in $rows)
26 - #set ($fullName = $row[0])
25 + #set ($fullName = $row[0]) ## e.g. "Main.Member Management"
27 27   #set ($catDoc = $xwiki.getDocument($fullName))
28 28   #set ($discard = $categories.add($catDoc))
29 29  #end
30 30  
31 -## Optional description overrides (rest of your code stays the same)
30 +## ------------------------------------------------------------
31 +## 2) Optional: description overrides by category label
32 +## Keys must match the *display title* (e.g. "Member Management")
33 +## ------------------------------------------------------------
32 32  #set ($categoryDescriptions = {
33 33   "Member Management": "How to manage members, families, and profiles.",
34 34   "Configuration": "Set up locations, billing, and core system settings.",