Last modified by Isaac Mejia on 2026/06/08 19:59

From version 2.1
edited by Isaac Mejia
on 2026/05/20 18:33
Change comment: There is no comment for this version
To version 4.1
edited by Isaac Mejia
on 2026/05/27 15:35
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,1 +1,224 @@
1 -{{children/}}
1 +{{velocity}}
2 +## ---------------------------------------------
3 +## KB Home (Main.WebHome)
4 +## eFit Financial Knowledge Base
5 +## ---------------------------------------------
6 +
7 +## 1) Find all top-level spaces in the efit wiki
8 +#set ($xwql =
9 + "select doc.fullName, doc.title, doc.name, doc.space " +
10 + "from XWikiDocument doc " +
11 + "where doc.name = 'WebHome' " +
12 + "and doc.space <> 'Main' " +
13 + "and doc.space <> 'XWiki' " +
14 + "and doc.space <> 'xwiki' " +
15 + "and doc.hidden <> true " +
16 + "order by lower(doc.space)"
17 +)##
18 +#set ($query = $services.query.xwql($xwql))##
19 +#set ($rows = $query.execute())##
20 +
21 +## 2) Icon map
22 +#set ($kbCategoryIcons = {
23 + "User_Guides": "📘",
24 + "Announcements": "📣",
25 + "Technical_Knowledge_Base": "⚙️"
26 +})##
27 +
28 +## 3) Descriptions
29 +#set ($kbCategoryDescriptions = {
30 + "User_Guides": "Step-by-step guides for using Club Advantage.",
31 + "Announcements": "Feature releases and platform updates.",
32 + "Technical_Knowledge_Base": "Technical guides and troubleshooting."
33 +})##
34 +
35 +## 4) Display names
36 +#set ($kbCategoryLabels = {
37 + "User_Guides": "User Guides",
38 + "Announcements": "Announcements",
39 + "Technical_Knowledge_Base": "Technical Knowledge Base"
40 +})##
41 +
42 +## 5) Allowlist
43 +#set ($allowedSpaces = ["User_Guides", "Announcements", "Technical_Knowledge_Base"])##
44 +
45 +## 6) Build category objects
46 +#set ($kbCategories = [])##
47 +
48 +#foreach ($space in $allowedSpaces)##
49 + #set ($label = $kbCategoryLabels.get($space))##
50 + #set ($desc = $kbCategoryDescriptions.get($space))##
51 + #set ($icon = $kbCategoryIcons.get($space))##
52 +
53 + ## Count non-hidden, non-WebHome pages in this space and subspaces
54 + #set ($articleCount = 0)##
55 + #set ($countXwql =
56 + "select count(doc.fullName) " +
57 + "from XWikiDocument doc " +
58 + "where (doc.space = :space or doc.space like :spacePrefix) " +
59 + "and doc.name <> 'WebHome' " +
60 + "and doc.hidden <> true"
61 + )##
62 + #set ($countQuery = $services.query.xwql($countXwql))##
63 + #set ($discard = $countQuery.bindValue("space", $space))##
64 + #set ($discard = $countQuery.bindValue("spacePrefix", $space + ".%"))##
65 + #set ($resultList = $countQuery.execute())##
66 + #if ($resultList && $resultList.size() > 0)##
67 + #set ($articleCount = $resultList.get(0))##
68 + #end##
69 +
70 + ## Build clean URL
71 + #set ($cleanUrl = "/" + $space + "/")##
72 +
73 + #set ($entry = {
74 + "label": $label,
75 + "desc": $desc,
76 + "icon": $icon,
77 + "url": $cleanUrl,
78 + "count": $articleCount
79 + })##
80 + #set ($discard = $kbCategories.add($entry))##
81 +#end##
82 +
83 +{{html clean="false"}}
84 +<div class="kb-home">
85 +
86 + <!-- HERO -->
87 + <div class="kb-hero">
88 + <h1 class="kb-hero-title">eFit Financial Knowledge Base</h1>
89 + <p class="kb-hero-subtitle">
90 + Guides, walkthroughs, and best practices to help you and your team get the most out of Club Advantage.
91 + </p>
92 + </div>
93 +
94 + <!-- CATEGORY GRID -->
95 + <div class="kb-section">
96 + <h2 class="kb-section-title">Browse by category</h2>
97 +
98 + <div class="kb-category-grid">
99 + #foreach ($cat in $kbCategories)
100 + #set ($label = $cat.get("label"))
101 + #set ($desc = $cat.get("desc"))
102 + #set ($icon = $cat.get("icon"))
103 + #set ($url = $cat.get("url"))
104 + #set ($count = $cat.get("count"))
105 +
106 + <a class="kb-card" href="$url">
107 + <div>
108 + <div class="kb-card-title">
109 + <span class="kb-card-icon">$icon</span>
110 + $escapetool.xml($label)
111 + </div>
112 + <div class="kb-card-body">
113 + $escapetool.xml($desc)
114 + </div>
115 + </div>
116 + <div class="kb-card-meta">
117 + #if ($count == 1)
118 + 1 article
119 + #elseif ($count > 1)
120 + $count articles
121 + #else
122 + Category
123 + #end
124 + </div>
125 + </a>
126 + #end
127 + </div>
128 + </div>
129 +
130 +</div>
131 +
132 +<style>
133 +body.viewbody.page-WebHome #xwikicontent .kb-hero {
134 + padding: 4.2rem 1rem 3.3rem !important;
135 + max-width: 1100px;
136 + margin: 0 auto;
137 + text-align: center;
138 +}
139 +
140 +body.viewbody.page-WebHome #xwikicontent .kb-hero-title {
141 + font-size: 3.5rem !important;
142 + font-weight: 800 !important;
143 + line-height: 1.15;
144 + margin-bottom: 1rem !important;
145 + color: #0f172a;
146 +}
147 +
148 +body.viewbody.page-WebHome #xwikicontent .kb-hero-subtitle {
149 + font-size: 1.35rem !important;
150 + line-height: 1.7;
151 + color: #4b5563 !important;
152 + max-width: 720px;
153 + margin: 0 auto 2.3rem !important;
154 +}
155 +
156 +body.viewbody.page-WebHome #xwikicontent .kb-section {
157 + margin-top: 4.6rem !important;
158 +}
159 +
160 +body.viewbody.page-WebHome #xwikicontent .kb-section-title {
161 + text-align: center;
162 + font-size: 1.5rem;
163 + font-weight: 700;
164 + margin-bottom: 2rem;
165 + color: #0f172a;
166 +}
167 +
168 +body.viewbody.page-WebHome #xwikicontent .kb-category-grid {
169 + display: grid;
170 + grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
171 + gap: 1.5rem;
172 + max-width: 1100px;
173 + margin: 0 auto;
174 + padding: 0 1rem;
175 +}
176 +
177 +body.viewbody.page-WebHome #xwikicontent .kb-card {
178 + display: flex;
179 + flex-direction: column;
180 + justify-content: space-between;
181 + padding: 1.5rem;
182 + border: 1px solid #e5e7eb;
183 + border-radius: 12px;
184 + text-decoration: none;
185 + color: inherit;
186 + background: #fff;
187 + box-shadow: 0 1px 3px rgba(0,0,0,0.06);
188 + transition: box-shadow 0.2s, transform 0.2s;
189 +}
190 +
191 +body.viewbody.page-WebHome #xwikicontent .kb-card:hover {
192 + box-shadow: 0 8px 24px rgba(0,0,0,0.1);
193 + transform: translateY(-2px);
194 +}
195 +
196 +body.viewbody.page-WebHome #xwikicontent .kb-card-title {
197 + font-size: 1.1rem;
198 + font-weight: 700;
199 + color: #2563eb;
200 + margin-bottom: 0.5rem;
201 +}
202 +
203 +body.viewbody.page-WebHome #xwikicontent .kb-card-icon {
204 + margin-right: 0.4rem;
205 +}
206 +
207 +body.viewbody.page-WebHome #xwikicontent .kb-card-body {
208 + font-size: 0.95rem;
209 + color: #6b7280;
210 + line-height: 1.5;
211 +}
212 +
213 +body.viewbody.page-WebHome #xwikicontent .kb-card-meta {
214 + margin-top: 1rem;
215 + font-size: 0.85rem;
216 + color: #9ca3af;
217 + text-transform: uppercase;
218 + letter-spacing: 0.05em;
219 +}
220 +</style>
221 +
222 +{{/html}}
223 +{{/velocity}}
224 +{{include reference="KBSupportCTA.WebHome"/}}