Changes for page Home

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

From version 5.1
edited by Isaac Mejia
on 2025/11/21 16:35
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
... ... @@ -1,74 +1,116 @@
1 +{{velocity}}
2 +## KB Home (Main.WebHome)
3 +
4 +## ------------------------------------------------------------
5 +## 1) Discover category pages automatically
6 +## - Category pages live at: Main.<CategoryLabel>.WebHome
7 +## - We query all docs in space=Main except WebHome + KB-Categories
8 +## ------------------------------------------------------------
9 +#set ($xwql =
10 + "select doc.fullName, doc.title " +
11 + "from XWikiDocument doc " +
12 + "where doc.space = :space " +
13 + "and doc.name <> 'WebHome' " +
14 + "and doc.name <> 'KB-Categories' " +
15 + "and doc.hidden <> true " +
16 + "order by lower(doc.title)"
17 +)
18 +
19 +#set ($query = $services.query.xwql($xwql).bindValue("space", "Main"))
20 +#set ($rows = $query.execute())
21 +
22 +## Build a list of document objects for convenience
23 +#set ($categories = [])
24 +#foreach ($row in $rows)
25 + #set ($fullName = $row[0]) ## e.g. "Main.Member Management"
26 + #set ($catDoc = $xwiki.getDocument($fullName))
27 + #set ($discard = $categories.add($catDoc))
28 +#end
29 +
30 +## ------------------------------------------------------------
31 +## 2) Optional: description overrides by category label
32 +## Keys must match the *display title* (e.g. "Member Management")
33 +## ------------------------------------------------------------
34 +#set ($categoryDescriptions = {
35 + "Member Management": "How to manage members, families, and profiles.",
36 + "Configuration": "Set up locations, billing, and core system settings.",
37 + "Billing & Payments": "Invoices, collections, and payment processing.",
38 + "Reporting & Analytics": "Understand your numbers and performance.",
39 + "Integrations": "Connect eFit with other tools in your stack."
40 +})
41 +
1 1  {{html clean="false"}}
43 +<div class="kb-home">
2 2  
3 -<div class="kb-hero">
4 - <h1 class="kb-hero-title">Welcome to the Member Solutions Knowledge Base</h1>
5 - <p class="kb-hero-subtitle">
6 - Guides, troubleshooting, and best practices to help you run a better business.
7 - </p>
45 + <!-- HERO -->
46 + <div class="kb-hero">
47 + <h1 class="kb-hero-title">Member Solutions Knowledge Base</h1>
48 + <p class="kb-hero-subtitle">
49 + Guides, walkthroughs, and best practices to help you and your team get the most out of the platform.
50 + </p>
8 8  
9 - <!-- Simple search form that goes to the WebSearch page -->
10 - <form class="kb-hero-search" method="get" action="/bin/view/Main/WebSearch">
11 - <input type="text" name="text" placeholder="Search for articles..." />
12 - </form>
13 -</div>
52 + <!-- Simple search box that posts to XWiki search -->
53 + <div class="kb-hero-search">
54 + <form action="$xwiki.getURL('Main.WebHome', 'view')" method="get">
55 + <input
56 + type="text"
57 + name="text"
58 + placeholder="Search for an article (e.g. &quot;family membership&quot;)"
59 + />
60 + </form>
61 + </div>
62 + </div>
14 14  
15 -<div class="kb-section">
16 - <h2 class="kb-section-title">Browse by category</h2>
17 - <div class="kb-category-grid">
64 + <!-- CATEGORY GRID -->
65 + <div class="kb-section">
66 + <h2 class="kb-section-title">Browse by category</h2>
18 18  
19 - <a class="kb-card" href="/bin/view/Main/GettingStarted">
20 - <h3 class="kb-card-title">Getting Started</h3>
21 - <p class="kb-card-body">
22 - Start here to set up your account and learn the basics.
23 - </p>
24 - <span class="kb-card-meta">Setup • Onboarding</span>
25 - </a>
68 + <div class="kb-category-grid">
69 + #foreach ($catDoc in $categories)
70 + ## Label shown on the card
71 + #set ($label = $catDoc.displayTitle) ## e.g. "Member Management"
26 26  
27 - <a class="kb-card" href="/bin/view/Main/BillingPayments">
28 - <h3 class="kb-card-title">Billing &amp; Payments</h3>
29 - <p class="kb-card-body">
30 - Invoices, payments, autopay, collections, and more.
31 - </p>
32 - <span class="kb-card-meta">Finance</span>
33 - </a>
73 + ## Space/page name used in the URL path:
74 + ## uploader created category pages as Main.<Label>.WebHome,
75 + ## so doc.name is the space segment we need (with spaces).
76 + #set ($spaceName = $catDoc.name) ## e.g. "Member Management"
34 34  
35 - <a class="kb-card" href="/bin/view/Main/MemberManagement">
36 - <h3 class="kb-card-title">Member Management</h3>
37 - <p class="kb-card-body">
38 - Day-to-day operations for memberships and classes.
39 - </p>
40 - <span class="kb-card-meta">Members • Attendance</span>
41 - </a>
78 + ## Description: use override map if present, else generic
79 + #set ($desc = $categoryDescriptions.get($label))
80 + #if (!$desc)
81 + #set ($desc = "Articles and guides for " + $label)
82 + #end
42 42  
43 - <a class="kb-card" href="/bin/view/Main/Integrations">
44 - <h3 class="kb-card-title">Integrations</h3>
45 - <p class="kb-card-body">
46 - Automations, data sync, APIs, and external tools.
47 - </p>
48 - <span class="kb-card-meta">Automations</span>
49 - </a>
84 + ## Build clean URL: /bin/view/Main/<SpaceName> (no trailing slash)
85 + #set ($encoded = $escapetool.url($spaceName))
86 + #set ($cleanUrl = "/bin/view/Main/$encoded")
50 50  
88 + <a class="kb-card" href="$cleanUrl">
89 + <div>
90 + <div class="kb-card-title">$escapetool.xml($label)</div>
91 + <div class="kb-card-body">
92 + $escapetool.xml($desc)
93 + </div>
94 + </div>
95 + <div class="kb-card-meta">Category</div>
96 + </a>
97 + #end
98 + </div>
51 51   </div>
52 -</div>
53 53  
54 -<div class="kb-section">
55 - <h2 class="kb-section-title">Popular articles</h2>
56 - <ul class="kb-popular-list">
57 - <li><a href="/bin/view/Main/ImportingData">How to import member data</a></li>
58 - <li><a href="/bin/view/Main/BillingBasics">Billing basics: everything you need to know</a></li>
59 - <li><a href="/bin/view/Main/DigitalCheckin">Using digital check-in</a></li>
60 - <li><a href="/bin/view/Main/EventSetup">Creating your first event</a></li>
61 - </ul>
62 -</div>
63 -
64 -<div class="kb-cta">
65 - <div class="kb-cta-content">
66 - <h2>Need more help?</h2>
67 - <p>Our support team is here for you.</p>
68 - <a class="kb-cta-button" href="/bin/view/Main/ContactSupport">
101 + <!-- BOTTOM CTA -->
102 + <div class="kb-cta">
103 + <div class="kb-cta-content">
104 + <h2>Still need help?</h2>
105 + <p>
106 + If you can’t find what you’re looking for, our support team is happy to help.
107 + </p>
108 + </div>
109 + <a href="mailto:support@membersolutions.com" class="kb-cta-button">
69 69   Contact Support
70 70   </a>
71 71   </div>
72 -</div>
73 73  
114 +</div>
74 74  {{/html}}
116 +{{/velocity}}