domma-cms 0.9.5 → 0.9.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/admin/js/app.js +2 -2
- package/admin/js/lib/card-builder.js +7 -0
- package/admin/js/templates/api-reference.html +943 -1107
- package/admin/js/templates/documentation.html +828 -655
- package/admin/js/templates/tutorials.html +202 -177
- package/admin/js/views/api-reference.js +1 -1
- package/admin/js/views/documentation.js +1 -1
- package/admin/js/views/index.js +1 -1
- package/admin/js/views/page-editor.js +4 -4
- package/admin/js/views/plugins.js +10 -16
- package/admin/js/views/tutorials.js +1 -1
- package/config/plugins.json +4 -14
- package/config/site.json +1 -1
- package/package.json +1 -1
- package/plugins/notes/admin/views/notes.js +24 -25
- package/plugins/todo/admin/views/todo.js +32 -33
- package/public/css/site.css +1 -1
- package/server/services/markdown.js +609 -79
|
@@ -5,46 +5,58 @@
|
|
|
5
5
|
<div class="row">
|
|
6
6
|
<div class="col-12">
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
<div class="tabs" id="docs-tabs">
|
|
9
|
+
<div class="tab-list" style="flex-wrap: wrap;">
|
|
10
|
+
<button class="tab-item active">Pages</button>
|
|
11
|
+
<button class="tab-item">Media</button>
|
|
12
|
+
<button class="tab-item">Navigation</button>
|
|
13
|
+
<button class="tab-item">DConfig</button>
|
|
14
|
+
<button class="tab-item">Shortcodes</button>
|
|
15
|
+
<button class="tab-item">Site Settings</button>
|
|
16
|
+
<button class="tab-item">Plugins</button>
|
|
17
|
+
<button class="tab-item">Users & Roles</button>
|
|
18
|
+
<button class="tab-item">Views</button>
|
|
19
|
+
<button class="tab-item">Actions</button>
|
|
20
|
+
<button class="tab-item">CTA Shortcode</button>
|
|
13
21
|
</div>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
22
|
+
<div class="tab-content">
|
|
23
|
+
|
|
24
|
+
<!-- Pages -->
|
|
25
|
+
<div class="tab-panel active docs-body">
|
|
26
|
+
<p>Pages are stored as Markdown files in <code>content/pages/</code>. Each file has a YAML frontmatter
|
|
27
|
+
block at
|
|
28
|
+
the top followed by the page body in Markdown.</p>
|
|
29
|
+
|
|
30
|
+
<h3>URL mapping</h3>
|
|
31
|
+
<table class="table table-sm">
|
|
32
|
+
<thead>
|
|
33
|
+
<tr>
|
|
34
|
+
<th>File path</th>
|
|
35
|
+
<th>Public URL</th>
|
|
36
|
+
</tr>
|
|
37
|
+
</thead>
|
|
38
|
+
<tbody>
|
|
39
|
+
<tr>
|
|
40
|
+
<td><code>content/pages/index.md</code></td>
|
|
41
|
+
<td><code>/</code></td>
|
|
42
|
+
</tr>
|
|
43
|
+
<tr>
|
|
44
|
+
<td><code>content/pages/about.md</code></td>
|
|
45
|
+
<td><code>/about</code></td>
|
|
46
|
+
</tr>
|
|
47
|
+
<tr>
|
|
48
|
+
<td><code>content/pages/blog/index.md</code></td>
|
|
49
|
+
<td><code>/blog</code></td>
|
|
50
|
+
</tr>
|
|
51
|
+
<tr>
|
|
52
|
+
<td><code>content/pages/blog/hello-world.md</code></td>
|
|
53
|
+
<td><code>/blog/hello-world</code></td>
|
|
54
|
+
</tr>
|
|
55
|
+
</tbody>
|
|
56
|
+
</table>
|
|
57
|
+
|
|
58
|
+
<h3>Frontmatter reference</h3>
|
|
59
|
+
<pre class="code-block"><code>---
|
|
48
60
|
title: My Page
|
|
49
61
|
description: A short description for SEO meta tags.
|
|
50
62
|
status: published # published | draft (draft pages return 404)
|
|
@@ -57,85 +69,76 @@ updatedAt: 2026-03-01 # auto-set on save
|
|
|
57
69
|
|
|
58
70
|
Your Markdown content goes here.</code></pre>
|
|
59
71
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
72
|
+
<h3>Drafts</h3>
|
|
73
|
+
<p>Pages with <code>status: draft</code> are never served on the public site — they return a 404.
|
|
74
|
+
Toggle status
|
|
75
|
+
in the Page Editor to publish.</p>
|
|
63
76
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
77
|
+
<h3>Layouts</h3>
|
|
78
|
+
<p>Layouts are defined in <code>config/presets.json</code> and apply CSS class wrappers around page
|
|
79
|
+
content.
|
|
80
|
+
Select a layout per-page in the editor, or change the default in Site Settings.</p>
|
|
81
|
+
</div>
|
|
69
82
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
<span class="card-collapse-icon" data-icon="chevron-down"></span>
|
|
75
|
-
</div>
|
|
76
|
-
<div class="card-body docs-body">
|
|
77
|
-
<p>Media files are stored in <code>content/media/</code> and served publicly at <code>/media/{filename}</code>.
|
|
78
|
-
</p>
|
|
83
|
+
<!-- Media -->
|
|
84
|
+
<div class="tab-panel docs-body">
|
|
85
|
+
<p>Media files are stored in <code>content/media/</code> and served publicly at <code>/media/{filename}</code>.
|
|
86
|
+
</p>
|
|
79
87
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
88
|
+
<h3>Using media in pages</h3>
|
|
89
|
+
<p>Reference uploaded files by their public URL in Markdown:</p>
|
|
90
|
+
<pre class="code-block"><code>
|
|
83
91
|
|
|
84
92
|
<img src="/media/my-image.jpg" alt="Alt text"></code></pre>
|
|
85
93
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
</li>
|
|
135
|
-
</ul>
|
|
136
|
-
|
|
137
|
-
<h3>Schema</h3>
|
|
138
|
-
<pre class="code-block"><code>{
|
|
94
|
+
<h3>Upload limits</h3>
|
|
95
|
+
<p>The maximum file size is configured in <code>config/server.json</code> under <code>uploads.maxFileSize</code>
|
|
96
|
+
(bytes). Default is 10 MB.</p>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<!-- Navigation -->
|
|
100
|
+
<div class="tab-panel docs-body">
|
|
101
|
+
<p>The navigation tree is stored in <code>config/navigation.json</code> and injected into every public
|
|
102
|
+
page as
|
|
103
|
+
<code>window.__CMS_NAV__</code>.</p>
|
|
104
|
+
|
|
105
|
+
<h3>Dropdowns</h3>
|
|
106
|
+
<p>Nest items under a parent using the drag-and-drop tree in the Navigation editor. Child items are
|
|
107
|
+
stored under
|
|
108
|
+
the <code>items</code> key — the public navbar renders them as a dropdown.</p>
|
|
109
|
+
|
|
110
|
+
<h3>External links</h3>
|
|
111
|
+
<p>Set the URL to a full <code>https://</code> address to link outside the site. Leave blank for
|
|
112
|
+
section
|
|
113
|
+
headings.</p>
|
|
114
|
+
|
|
115
|
+
<h3>Icons</h3>
|
|
116
|
+
<p>Set the <code>icon</code> field to any registered icon name. Icons appear in the navbar link
|
|
117
|
+
alongside the
|
|
118
|
+
label.</p>
|
|
119
|
+
</div>
|
|
120
|
+
|
|
121
|
+
<!-- DConfig -->
|
|
122
|
+
<div class="tab-panel docs-body">
|
|
123
|
+
<p>DConfig lets you wire up declarative behaviour on any public page — no JavaScript required. Define
|
|
124
|
+
event
|
|
125
|
+
handlers and class toggles in JSON; the page runtime applies them automatically on load.</p>
|
|
126
|
+
|
|
127
|
+
<p>DConfig can be set in two ways, and both are merged at runtime (inline shortcode wins on selector
|
|
128
|
+
conflict):</p>
|
|
129
|
+
<ul>
|
|
130
|
+
<li><strong>Page editor</strong> — the <em>DConfig</em> collapsible section accepts a JSON blob
|
|
131
|
+
stored in page
|
|
132
|
+
frontmatter and injected as <code>window.__CMS_DCONFIG__</code>.
|
|
133
|
+
</li>
|
|
134
|
+
<li><strong>Inline shortcode</strong> — place one or more <code>[dconfig]…[/dconfig]</code> blocks
|
|
135
|
+
directly in
|
|
136
|
+
the page body Markdown.
|
|
137
|
+
</li>
|
|
138
|
+
</ul>
|
|
139
|
+
|
|
140
|
+
<h3>Schema</h3>
|
|
141
|
+
<pre class="code-block"><code>{
|
|
139
142
|
"#selector": {
|
|
140
143
|
"events": {
|
|
141
144
|
"eventName": {
|
|
@@ -146,51 +149,53 @@ Your Markdown content goes here.</code></pre>
|
|
|
146
149
|
}
|
|
147
150
|
}</code></pre>
|
|
148
151
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
152
|
+
<p>Multiple selectors and multiple event types can appear in a single config block.</p>
|
|
153
|
+
|
|
154
|
+
<h3>Supported events</h3>
|
|
155
|
+
<table class="table table-sm">
|
|
156
|
+
<thead>
|
|
157
|
+
<tr>
|
|
158
|
+
<th>Event</th>
|
|
159
|
+
<th>Description</th>
|
|
160
|
+
</tr>
|
|
161
|
+
</thead>
|
|
162
|
+
<tbody>
|
|
163
|
+
<tr>
|
|
164
|
+
<td><code>click</code></td>
|
|
165
|
+
<td>Fires when the selector element is clicked.</td>
|
|
166
|
+
</tr>
|
|
167
|
+
</tbody>
|
|
168
|
+
</table>
|
|
169
|
+
|
|
170
|
+
<h3>Supported actions</h3>
|
|
171
|
+
<table class="table table-sm">
|
|
172
|
+
<thead>
|
|
173
|
+
<tr>
|
|
174
|
+
<th>Action key</th>
|
|
175
|
+
<th>Value type</th>
|
|
176
|
+
<th>Description</th>
|
|
177
|
+
</tr>
|
|
178
|
+
</thead>
|
|
179
|
+
<tbody>
|
|
180
|
+
<tr>
|
|
181
|
+
<td><code>toggleClass</code></td>
|
|
182
|
+
<td><code>string</code></td>
|
|
183
|
+
<td>Adds the class if absent, removes it if present, on the <code>target</code> element.
|
|
184
|
+
Typical use:
|
|
185
|
+
show/hide content with a <code>hidden</code> class.
|
|
186
|
+
</td>
|
|
187
|
+
</tr>
|
|
188
|
+
</tbody>
|
|
189
|
+
</table>
|
|
190
|
+
|
|
191
|
+
<p><em>Additional actions (addClass, removeClass, setAttribute, scroll-to) are planned for future
|
|
192
|
+
releases.</em></p>
|
|
193
|
+
|
|
194
|
+
<h3>Targeting shortcode elements with <code>id</code></h3>
|
|
195
|
+
<p>All shortcodes support an <code>id</code> attribute, which is written directly onto the generated
|
|
196
|
+
element.
|
|
197
|
+
Use this instead of raw HTML when you want DConfig to target a card, column, or grid:</p>
|
|
198
|
+
<pre class="code-block"><code>[card id="my-panel" title="Hidden Details"]
|
|
194
199
|
Content goes here.
|
|
195
200
|
[/card]
|
|
196
201
|
|
|
@@ -203,10 +208,10 @@ Content goes here.
|
|
|
203
208
|
}
|
|
204
209
|
}
|
|
205
210
|
[/dconfig]</code></pre>
|
|
206
|
-
|
|
211
|
+
<p>Supported on: <code>[card]</code>, <code>[col]</code>, <code>[row]</code>, <code>[grid]</code>.</p>
|
|
207
212
|
|
|
208
|
-
|
|
209
|
-
|
|
213
|
+
<h3>Using the <code>[dconfig]</code> shortcode</h3>
|
|
214
|
+
<pre class="code-block"><code>[dconfig]
|
|
210
215
|
{
|
|
211
216
|
"#my-btn": {
|
|
212
217
|
"events": {
|
|
@@ -222,10 +227,10 @@ Content goes here.
|
|
|
222
227
|
<div class="card-body">Hidden content.</div>
|
|
223
228
|
</div></code></pre>
|
|
224
229
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
230
|
+
<h3>Multiple selectors</h3>
|
|
231
|
+
<p>Any number of selectors can appear in one block. Selectors are matched with
|
|
232
|
+
<code>document.querySelector</code> — use IDs, classes, or attribute selectors.</p>
|
|
233
|
+
<pre class="code-block"><code>[dconfig]
|
|
229
234
|
{
|
|
230
235
|
"#show-btn": {
|
|
231
236
|
"events": {
|
|
@@ -240,511 +245,679 @@ Content goes here.
|
|
|
240
245
|
}
|
|
241
246
|
[/dconfig]</code></pre>
|
|
242
247
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
248
|
+
<h3>Using the page editor DConfig section</h3>
|
|
249
|
+
<p>The same JSON (without the shortcode tags) can be pasted directly into the <em>DConfig</em> card in
|
|
250
|
+
the page
|
|
251
|
+
editor. This is useful when the config should apply to the whole page without appearing in the
|
|
252
|
+
body content.
|
|
253
|
+
Inline <code>[dconfig]</code> shortcodes are applied last and will win on any shared selector key.
|
|
254
|
+
</p>
|
|
255
|
+
|
|
256
|
+
<p>See live demos on the <a href="/resources/interactive" target="_blank">Interactive Resources
|
|
257
|
+
page</a>.</p>
|
|
258
|
+
</div>
|
|
259
|
+
|
|
260
|
+
<!-- Shortcodes -->
|
|
261
|
+
<div class="tab-panel docs-body">
|
|
262
|
+
<p>Shortcodes extend Markdown with layout components. They are processed server-side before Markdown
|
|
263
|
+
rendering, so you can freely mix shortcodes and Markdown in the same page body.</p>
|
|
264
|
+
<p><strong>Syntax:</strong> <code>[shortcode attribute="value"]</code> (self-closing: <code>[shortcode
|
|
265
|
+
/]</code>) and <code>[/shortcode]</code> for paired tags.</p>
|
|
266
|
+
|
|
267
|
+
<h3>Layout</h3>
|
|
268
|
+
<table class="table table-sm">
|
|
269
|
+
<thead>
|
|
270
|
+
<tr>
|
|
271
|
+
<th>Shortcode</th>
|
|
272
|
+
<th>Description</th>
|
|
273
|
+
</tr>
|
|
274
|
+
</thead>
|
|
275
|
+
<tbody>
|
|
276
|
+
<tr>
|
|
277
|
+
<td><code>[grid cols="N" gap="N"]...[/grid]</code></td>
|
|
278
|
+
<td>CSS Grid container — N columns (1–12), optional gap (1–6)</td>
|
|
279
|
+
</tr>
|
|
280
|
+
<tr>
|
|
281
|
+
<td><code>[row gap="N"]...[/row]</code></td>
|
|
282
|
+
<td>Flexbox row — columns share width equally</td>
|
|
283
|
+
</tr>
|
|
284
|
+
<tr>
|
|
285
|
+
<td><code>[col span="N"]...[/col]</code></td>
|
|
286
|
+
<td>Column inside a grid or row; <code>span</code> sets column span</td>
|
|
287
|
+
</tr>
|
|
288
|
+
</tbody>
|
|
289
|
+
</table>
|
|
290
|
+
|
|
291
|
+
<h3>Components</h3>
|
|
292
|
+
<table class="table table-sm">
|
|
293
|
+
<thead>
|
|
294
|
+
<tr>
|
|
295
|
+
<th>Shortcode</th>
|
|
296
|
+
<th>Description</th>
|
|
297
|
+
</tr>
|
|
298
|
+
</thead>
|
|
299
|
+
<tbody>
|
|
300
|
+
<tr>
|
|
301
|
+
<td><code>[card title="..."]...[/card]</code></td>
|
|
302
|
+
<td>Styled card; <code>collapsible="true"</code> makes the body toggleable</td>
|
|
303
|
+
</tr>
|
|
304
|
+
<tr>
|
|
305
|
+
<td><code>[tabs]...[/tabs]</code></td>
|
|
306
|
+
<td>Tab group; use <code>[tab title="..."]...[/tab]</code> inside</td>
|
|
307
|
+
</tr>
|
|
308
|
+
<tr>
|
|
309
|
+
<td><code>[accordion]...[/accordion]</code></td>
|
|
310
|
+
<td>Accordion group; use <code>[item title="..."]...[/item]</code> inside</td>
|
|
311
|
+
</tr>
|
|
312
|
+
<tr>
|
|
313
|
+
<td><code>[carousel]...[/carousel]</code></td>
|
|
314
|
+
<td>Carousel; use <code>[slide]...[/slide]</code> inside</td>
|
|
315
|
+
</tr>
|
|
316
|
+
<tr>
|
|
317
|
+
<td><code>[badge variant="success"]...[/badge]</code></td>
|
|
318
|
+
<td>Inline badge; variants: primary, secondary, success, danger, warning, info</td>
|
|
319
|
+
</tr>
|
|
320
|
+
<tr>
|
|
321
|
+
<td><code>[icon name="star" /]</code></td>
|
|
322
|
+
<td>Inline Domma icon; optional <code>size</code> and <code>color</code></td>
|
|
323
|
+
</tr>
|
|
324
|
+
<tr>
|
|
325
|
+
<td><code>[spacer size="16" /]</code></td>
|
|
326
|
+
<td>Vertical whitespace block (px height)</td>
|
|
327
|
+
</tr>
|
|
328
|
+
<tr>
|
|
329
|
+
<td><code>[timeline]...[/timeline]</code></td>
|
|
330
|
+
<td>Progression timeline; use <code>[event title="..." date="..."
|
|
331
|
+
status="..."]...[/event]</code> inside
|
|
332
|
+
</td>
|
|
333
|
+
</tr>
|
|
334
|
+
<tr>
|
|
335
|
+
<td><code>[countdown to="2026-12-31" /]</code></td>
|
|
336
|
+
<td>Animated countdown to a date</td>
|
|
337
|
+
</tr>
|
|
338
|
+
</tbody>
|
|
339
|
+
</table>
|
|
340
|
+
|
|
341
|
+
<h3>Content</h3>
|
|
342
|
+
<table class="table table-sm">
|
|
343
|
+
<thead>
|
|
344
|
+
<tr>
|
|
345
|
+
<th>Shortcode</th>
|
|
346
|
+
<th>Description</th>
|
|
347
|
+
</tr>
|
|
348
|
+
</thead>
|
|
349
|
+
<tbody>
|
|
350
|
+
<tr>
|
|
351
|
+
<td><code>[hero variant="dark" size="sm"]...[/hero]</code></td>
|
|
352
|
+
<td>Full-width hero section; supports <code>twinkle</code>, <code>blobs</code>,
|
|
353
|
+
<code>image</code>, <code>overlay</code></td>
|
|
354
|
+
</tr>
|
|
355
|
+
<tr>
|
|
356
|
+
<td><code>[table striped="true"]...[/table]</code></td>
|
|
357
|
+
<td>Wraps a GFM Markdown table with Domma table CSS classes</td>
|
|
358
|
+
</tr>
|
|
359
|
+
<tr>
|
|
360
|
+
<td><code>[form name="slug" /]</code></td>
|
|
361
|
+
<td>Embeds a Form Builder form by slug</td>
|
|
362
|
+
</tr>
|
|
363
|
+
<tr>
|
|
364
|
+
<td><code>[collection slug="..." display="table" /]</code></td>
|
|
365
|
+
<td>Renders collection entries inline (table, cards, or list)</td>
|
|
366
|
+
</tr>
|
|
367
|
+
</tbody>
|
|
368
|
+
</table>
|
|
369
|
+
|
|
370
|
+
<h3>Form follow-up</h3>
|
|
371
|
+
<p>Two optional settings control what happens after a submission is stored:</p>
|
|
372
|
+
<table class="table" style="font-size:.9rem;">
|
|
373
|
+
<thead>
|
|
374
|
+
<tr>
|
|
375
|
+
<th>Field</th>
|
|
376
|
+
<th>Where</th>
|
|
377
|
+
<th>Description</th>
|
|
378
|
+
</tr>
|
|
379
|
+
</thead>
|
|
380
|
+
<tbody>
|
|
381
|
+
<tr>
|
|
382
|
+
<td><code>successMessage</code></td>
|
|
383
|
+
<td>Settings tab</td>
|
|
384
|
+
<td>Text shown inline after submission (replaces the form). Default: "Thank you for your
|
|
385
|
+
submission."
|
|
386
|
+
</td>
|
|
387
|
+
</tr>
|
|
388
|
+
<tr>
|
|
389
|
+
<td><code>successRedirect</code></td>
|
|
390
|
+
<td>Settings tab</td>
|
|
391
|
+
<td>URL to redirect the visitor on success. Takes priority over <code>successMessage</code> if
|
|
392
|
+
set.
|
|
393
|
+
</td>
|
|
394
|
+
</tr>
|
|
395
|
+
<tr>
|
|
396
|
+
<td><code>actionSlug</code></td>
|
|
397
|
+
<td>Actions tab → CMS Action</td>
|
|
398
|
+
<td>Slug of a CMS Action to execute after the entry is stored. Requires Pro (MongoDB).
|
|
399
|
+
Non-fatal on failure.
|
|
400
|
+
</td>
|
|
401
|
+
</tr>
|
|
402
|
+
</tbody>
|
|
403
|
+
</table>
|
|
404
|
+
<p>For the full walkthrough, see the
|
|
405
|
+
<a href="#/tutorials">Tutorials → Form Follow-Up: Notifications & Actions</a> tutorial.</p>
|
|
406
|
+
|
|
407
|
+
<h3>Interactive</h3>
|
|
408
|
+
<table class="table table-sm">
|
|
409
|
+
<thead>
|
|
410
|
+
<tr>
|
|
411
|
+
<th>Shortcode</th>
|
|
412
|
+
<th>Description</th>
|
|
413
|
+
</tr>
|
|
414
|
+
</thead>
|
|
415
|
+
<tbody>
|
|
416
|
+
<tr>
|
|
417
|
+
<td><code>[slideover title="..." trigger="..."]...[/slideover]</code></td>
|
|
418
|
+
<td>Slide-in panel opened by a trigger button</td>
|
|
419
|
+
</tr>
|
|
420
|
+
<tr>
|
|
421
|
+
<td><code>[dconfig]{...}[/dconfig]</code></td>
|
|
422
|
+
<td>Declarative click handlers and class toggles — no JavaScript needed</td>
|
|
423
|
+
</tr>
|
|
424
|
+
</tbody>
|
|
425
|
+
</table>
|
|
426
|
+
|
|
427
|
+
<h3>Pro shortcodes</h3>
|
|
428
|
+
<table class="table table-sm">
|
|
429
|
+
<thead>
|
|
430
|
+
<tr>
|
|
431
|
+
<th>Shortcode</th>
|
|
432
|
+
<th>Description</th>
|
|
433
|
+
</tr>
|
|
434
|
+
</thead>
|
|
435
|
+
<tbody>
|
|
436
|
+
<tr>
|
|
437
|
+
<td><code>[view slug="..." display="table" /]</code></td>
|
|
438
|
+
<td>Executes a saved View and renders results. Requires MongoDB.</td>
|
|
439
|
+
</tr>
|
|
440
|
+
<tr>
|
|
441
|
+
<td><code>[cta action="..." entry="..."]Label[/cta]</code></td>
|
|
442
|
+
<td>Action-trigger button. Requires the visitor to be logged in.</td>
|
|
443
|
+
</tr>
|
|
444
|
+
</tbody>
|
|
445
|
+
</table>
|
|
446
|
+
|
|
447
|
+
<p>Full attribute reference and live demos: <a href="/resources/shortcodes" target="_blank">Shortcode
|
|
448
|
+
Reference</a> · <a href="/resources/components" target="_blank">Components</a> · <a
|
|
449
|
+
href="/resources/effects" target="_blank">Effects</a></p>
|
|
450
|
+
</div>
|
|
451
|
+
|
|
452
|
+
<!-- Site Settings -->
|
|
453
|
+
<div class="tab-panel docs-body">
|
|
454
|
+
<p>Site Settings are stored in <code>config/site.json</code> and editable from the Settings page in
|
|
455
|
+
the admin
|
|
456
|
+
panel.</p>
|
|
457
|
+
|
|
458
|
+
<table class="table table-sm">
|
|
459
|
+
<thead>
|
|
460
|
+
<tr>
|
|
461
|
+
<th>Field</th>
|
|
462
|
+
<th>Description</th>
|
|
463
|
+
</tr>
|
|
464
|
+
</thead>
|
|
465
|
+
<tbody>
|
|
466
|
+
<tr>
|
|
467
|
+
<td><code>siteName</code></td>
|
|
468
|
+
<td>Site title used in the public navbar and browser tab.</td>
|
|
469
|
+
</tr>
|
|
470
|
+
<tr>
|
|
471
|
+
<td><code>tagline</code></td>
|
|
472
|
+
<td>Subtitle shown in the public site footer.</td>
|
|
473
|
+
</tr>
|
|
474
|
+
<tr>
|
|
475
|
+
<td><code>adminTheme</code></td>
|
|
476
|
+
<td>Admin panel colour theme (e.g. <code>charcoal-dark</code>, <code>ocean-light</code>).</td>
|
|
477
|
+
</tr>
|
|
478
|
+
<tr>
|
|
479
|
+
<td><code>publicTheme</code></td>
|
|
480
|
+
<td>Public site theme applied to <code><html data-theme></code>.</td>
|
|
481
|
+
</tr>
|
|
482
|
+
<tr>
|
|
483
|
+
<td><code>defaultLayout</code></td>
|
|
484
|
+
<td>Fallback layout for pages that don't specify one.</td>
|
|
485
|
+
</tr>
|
|
486
|
+
</tbody>
|
|
487
|
+
</table>
|
|
488
|
+
|
|
489
|
+
<h3>Server configuration</h3>
|
|
490
|
+
<p>Low-level settings (port, CORS, upload size) live in <code>config/server.json</code> and require a
|
|
491
|
+
server
|
|
492
|
+
restart to take effect. These are not editable from the admin panel.</p>
|
|
493
|
+
</div>
|
|
494
|
+
|
|
495
|
+
<!-- Plugins -->
|
|
496
|
+
<div class="tab-panel docs-body">
|
|
497
|
+
<p>Plugins extend the CMS with new server routes, admin views, and public-site injection snippets.
|
|
498
|
+
Each plugin
|
|
499
|
+
is a directory under <code>plugins/</code>.</p>
|
|
500
|
+
|
|
501
|
+
<h3>Enabling and disabling</h3>
|
|
502
|
+
<p>Use the Plugins page in the admin to toggle plugins on or off. State is saved to
|
|
503
|
+
<code>config/plugins.json</code>. <strong>A server restart is required for changes to take
|
|
504
|
+
effect.</strong>
|
|
505
|
+
</p>
|
|
506
|
+
|
|
507
|
+
<h3>Plugin settings</h3>
|
|
508
|
+
<p>Plugins that expose a settings page will appear as a link in the sidebar under the Plugins section.
|
|
509
|
+
Settings
|
|
510
|
+
are merged with the plugin's defaults from <code>config.js</code> and saved to
|
|
511
|
+
<code>config/plugins.json</code>.</p>
|
|
512
|
+
|
|
513
|
+
<h3>Security</h3>
|
|
514
|
+
<p>Only files inside a plugin's <code>admin/</code> and <code>public/</code> subdirectories are served
|
|
515
|
+
statically. Server files (<code>plugin.js</code>, <code>config.js</code>, <code>data/</code>) are
|
|
516
|
+
blocked and
|
|
517
|
+
return 404.</p>
|
|
518
|
+
|
|
519
|
+
<p>See the <a href="#/tutorials">Tutorials</a> section for a guide to writing your own plugin.</p>
|
|
520
|
+
</div>
|
|
521
|
+
|
|
522
|
+
<!-- Users & Roles -->
|
|
523
|
+
<div class="tab-panel docs-body">
|
|
524
|
+
<p>Users are stored as individual JSON files in <code>content/users/</code>. Passwords are hashed with
|
|
525
|
+
bcrypt
|
|
526
|
+
and never returned by the API.</p>
|
|
527
|
+
|
|
528
|
+
<h3>Roles</h3>
|
|
529
|
+
<table class="table table-sm">
|
|
530
|
+
<thead>
|
|
531
|
+
<tr>
|
|
532
|
+
<th>Role</th>
|
|
533
|
+
<th>Access</th>
|
|
534
|
+
</tr>
|
|
535
|
+
</thead>
|
|
536
|
+
<tbody>
|
|
537
|
+
<tr>
|
|
538
|
+
<td><strong>Admin</strong></td>
|
|
539
|
+
<td>Full access — users, plugins, settings, all content.</td>
|
|
540
|
+
</tr>
|
|
541
|
+
<tr>
|
|
542
|
+
<td><strong>Manager</strong></td>
|
|
543
|
+
<td>Content + structure (navigation, layouts). No users or plugins.</td>
|
|
544
|
+
</tr>
|
|
545
|
+
<tr>
|
|
546
|
+
<td><strong>Editor</strong></td>
|
|
547
|
+
<td>Pages and media only.</td>
|
|
548
|
+
</tr>
|
|
549
|
+
<tr>
|
|
550
|
+
<td><strong>Subscriber</strong></td>
|
|
551
|
+
<td>Read-only access to the API.</td>
|
|
552
|
+
</tr>
|
|
553
|
+
</tbody>
|
|
554
|
+
</table>
|
|
555
|
+
|
|
556
|
+
<h3>Authentication</h3>
|
|
557
|
+
<p>The admin panel uses JWT Bearer tokens. Tokens are stored in the browser and automatically
|
|
558
|
+
refreshed.
|
|
559
|
+
Sessions expire according to <code>config/auth.json</code> — default is 24 hours.</p>
|
|
560
|
+
|
|
561
|
+
<h3>Views & Actions</h3>
|
|
562
|
+
<p>Views and Actions are pro-only features that require a MongoDB connection.
|
|
563
|
+
Both roles — Admin and Manager — can create, edit, and run Views and Actions.</p>
|
|
564
|
+
<table class="table table-sm">
|
|
565
|
+
<thead>
|
|
566
|
+
<tr>
|
|
567
|
+
<th>Role</th>
|
|
568
|
+
<th>Views</th>
|
|
569
|
+
<th>Actions</th>
|
|
570
|
+
</tr>
|
|
571
|
+
</thead>
|
|
572
|
+
<tbody>
|
|
573
|
+
<tr>
|
|
574
|
+
<td><strong>Admin</strong></td>
|
|
575
|
+
<td>Full access</td>
|
|
576
|
+
<td>Full access</td>
|
|
577
|
+
</tr>
|
|
578
|
+
<tr>
|
|
579
|
+
<td><strong>Manager</strong></td>
|
|
580
|
+
<td>Full access</td>
|
|
581
|
+
<td>Full access</td>
|
|
582
|
+
</tr>
|
|
583
|
+
<tr>
|
|
584
|
+
<td><strong>Editor</strong></td>
|
|
585
|
+
<td>No access</td>
|
|
586
|
+
<td>No access</td>
|
|
587
|
+
</tr>
|
|
588
|
+
<tr>
|
|
589
|
+
<td><strong>Subscriber</strong></td>
|
|
590
|
+
<td>No access</td>
|
|
591
|
+
<td>No access</td>
|
|
592
|
+
</tr>
|
|
593
|
+
</tbody>
|
|
594
|
+
</table>
|
|
595
|
+
</div>
|
|
596
|
+
|
|
597
|
+
<!-- Views -->
|
|
598
|
+
<div class="tab-panel docs-body">
|
|
599
|
+
<p>Views are admin-designed display configurations that query one or more Collections via a stored
|
|
600
|
+
MongoDB aggregation pipeline, then render the results in the admin panel.
|
|
601
|
+
Views require a MongoDB connection configured under <strong>Collections → Options</strong>.</p>
|
|
602
|
+
|
|
603
|
+
<h3>Creating a View</h3>
|
|
604
|
+
<ol>
|
|
605
|
+
<li>Navigate to <strong>Data → Views</strong> and click <strong>New View</strong>.</li>
|
|
606
|
+
<li><strong>Source tab</strong> — enter a title, choose the primary source collection, and select
|
|
607
|
+
the MongoDB connection.
|
|
608
|
+
</li>
|
|
609
|
+
<li><strong>Pipeline tab</strong> — add aggregation stages in order. Each stage has a type and a
|
|
610
|
+
JSON config object.
|
|
611
|
+
</li>
|
|
612
|
+
<li><strong>Display tab</strong> — choose table or list mode, set page size, and optionally define
|
|
613
|
+
column definitions.
|
|
614
|
+
</li>
|
|
615
|
+
<li><strong>Access tab</strong> — select which roles can access this view and whether it is
|
|
616
|
+
publicly accessible.
|
|
617
|
+
</li>
|
|
618
|
+
<li>Click <strong>Save View</strong>, then use <strong>Preview</strong> to execute and inspect the
|
|
619
|
+
results.
|
|
620
|
+
</li>
|
|
621
|
+
</ol>
|
|
622
|
+
|
|
623
|
+
<h3>Allowed Pipeline Stage Types</h3>
|
|
624
|
+
<table class="table table-sm">
|
|
625
|
+
<thead>
|
|
626
|
+
<tr>
|
|
627
|
+
<th>Stage</th>
|
|
628
|
+
<th>Purpose</th>
|
|
629
|
+
</tr>
|
|
630
|
+
</thead>
|
|
631
|
+
<tbody>
|
|
632
|
+
<tr>
|
|
633
|
+
<td><code>$match</code></td>
|
|
634
|
+
<td>Filter documents by condition</td>
|
|
635
|
+
</tr>
|
|
636
|
+
<tr>
|
|
637
|
+
<td><code>$lookup</code></td>
|
|
638
|
+
<td>Left join from another collection</td>
|
|
639
|
+
</tr>
|
|
640
|
+
<tr>
|
|
641
|
+
<td><code>$sort</code></td>
|
|
642
|
+
<td>Sort documents</td>
|
|
643
|
+
</tr>
|
|
644
|
+
<tr>
|
|
645
|
+
<td><code>$project</code></td>
|
|
646
|
+
<td>Include or exclude fields</td>
|
|
647
|
+
</tr>
|
|
648
|
+
<tr>
|
|
649
|
+
<td><code>$unwind</code></td>
|
|
650
|
+
<td>Deconstruct an array field</td>
|
|
651
|
+
</tr>
|
|
652
|
+
<tr>
|
|
653
|
+
<td><code>$addFields</code></td>
|
|
654
|
+
<td>Compute and add new fields</td>
|
|
655
|
+
</tr>
|
|
656
|
+
<tr>
|
|
657
|
+
<td><code>$group</code></td>
|
|
658
|
+
<td>Group and aggregate</td>
|
|
659
|
+
</tr>
|
|
660
|
+
<tr>
|
|
661
|
+
<td><code>$count</code></td>
|
|
662
|
+
<td>Count documents</td>
|
|
663
|
+
</tr>
|
|
664
|
+
<tr>
|
|
665
|
+
<td><code>$skip</code></td>
|
|
666
|
+
<td>Skip documents (added automatically for pagination)</td>
|
|
667
|
+
</tr>
|
|
668
|
+
<tr>
|
|
669
|
+
<td><code>$limit</code></td>
|
|
670
|
+
<td>Limit documents (added automatically for pagination)</td>
|
|
671
|
+
</tr>
|
|
672
|
+
</tbody>
|
|
673
|
+
</table>
|
|
674
|
+
<p>Forbidden stages (<code>$out</code>, <code>$merge</code>, <code>$function</code>, <code>$accumulator</code>,
|
|
675
|
+
<code>$graphLookup</code>) are rejected at save and execution time.</p>
|
|
676
|
+
|
|
677
|
+
<h3>Column Definitions</h3>
|
|
678
|
+
<p>On the Display tab, column definitions are a JSON array. Each object has a <code>key</code>
|
|
679
|
+
(dot-path into the result document) and a <code>label</code>.</p>
|
|
680
|
+
<pre class="code-block"><code>[
|
|
532
681
|
{ "key": "data.name", "label": "Name" },
|
|
533
682
|
{ "key": "data.email", "label": "Email" },
|
|
534
683
|
{ "key": "orders", "label": "Orders" }
|
|
535
684
|
]</code></pre>
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
685
|
+
<p>If no columns are defined, the preview auto-generates columns from the first result document.</p>
|
|
686
|
+
|
|
687
|
+
<h3>Public Access</h3>
|
|
688
|
+
<p>Tick <strong>Public</strong> on the Access tab to expose the view via
|
|
689
|
+
<code>GET /api/views/:slug/public</code> without requiring a login.
|
|
690
|
+
Leave it unticked to require JWT authentication with one of the allowed roles.</p>
|
|
691
|
+
</div>
|
|
692
|
+
|
|
693
|
+
<!-- Actions -->
|
|
694
|
+
<div class="tab-panel docs-body">
|
|
695
|
+
<p>Actions are admin-designed sequential workflow operations triggered against individual collection
|
|
696
|
+
entries. When an action is assigned to a collection, a trigger button appears per row in the
|
|
697
|
+
entry list. Actions require a MongoDB connection (pro mode).</p>
|
|
698
|
+
|
|
699
|
+
<h3>Creating an Action</h3>
|
|
700
|
+
<ol>
|
|
701
|
+
<li>Navigate to <strong>Data → Actions</strong> and click <strong>New Action</strong>.</li>
|
|
702
|
+
<li><strong>General tab</strong> — enter a title and select the target collection.</li>
|
|
703
|
+
<li><strong>Trigger tab</strong> — configure the button label, icon, and optional confirmation
|
|
704
|
+
message.
|
|
705
|
+
</li>
|
|
706
|
+
<li><strong>Steps tab</strong> — add steps in order. Each step runs sequentially; if one fails the
|
|
707
|
+
action stops.
|
|
708
|
+
</li>
|
|
709
|
+
<li><strong>Access tab</strong> — select which roles can trigger this action.</li>
|
|
710
|
+
<li>Click <strong>Save Action</strong>. The button will appear on the collection's entry list.
|
|
711
|
+
</li>
|
|
712
|
+
</ol>
|
|
713
|
+
|
|
714
|
+
<h3>Phase 1 Step Types</h3>
|
|
715
|
+
<table class="table table-sm">
|
|
716
|
+
<thead>
|
|
717
|
+
<tr>
|
|
718
|
+
<th>Step</th>
|
|
719
|
+
<th>What it does</th>
|
|
720
|
+
<th>Config fields</th>
|
|
721
|
+
</tr>
|
|
722
|
+
</thead>
|
|
723
|
+
<tbody>
|
|
724
|
+
<tr>
|
|
725
|
+
<td><code>updateField</code></td>
|
|
726
|
+
<td>Set a field on the entry to a new value</td>
|
|
727
|
+
<td><code>field</code>, <code>value</code></td>
|
|
728
|
+
</tr>
|
|
729
|
+
<tr>
|
|
730
|
+
<td><code>deleteEntry</code></td>
|
|
731
|
+
<td>Permanently delete the entry</td>
|
|
732
|
+
<td>None</td>
|
|
733
|
+
</tr>
|
|
734
|
+
<tr>
|
|
735
|
+
<td><code>moveToCollection</code></td>
|
|
736
|
+
<td>Create the entry in a target collection then delete it from the source</td>
|
|
737
|
+
<td><code>targetCollection</code></td>
|
|
738
|
+
</tr>
|
|
739
|
+
<tr>
|
|
740
|
+
<td><code>webhook</code></td>
|
|
741
|
+
<td>HTTP request to an external URL</td>
|
|
742
|
+
<td><code>url</code>, <code>method</code>, <code>body</code> (JSON)</td>
|
|
743
|
+
</tr>
|
|
744
|
+
<tr>
|
|
745
|
+
<td><code>email</code></td>
|
|
746
|
+
<td>Send an email via the configured SMTP transport</td>
|
|
747
|
+
<td><code>to</code>, <code>subject</code>, <code>template</code></td>
|
|
748
|
+
</tr>
|
|
749
|
+
</tbody>
|
|
750
|
+
</table>
|
|
751
|
+
|
|
752
|
+
<h3>Template Variables</h3>
|
|
753
|
+
<p>Step config fields support <code>{{variable}}</code> interpolation:</p>
|
|
754
|
+
<table class="table table-sm">
|
|
755
|
+
<thead>
|
|
756
|
+
<tr>
|
|
757
|
+
<th>Variable</th>
|
|
758
|
+
<th>Resolves to</th>
|
|
759
|
+
</tr>
|
|
760
|
+
</thead>
|
|
761
|
+
<tbody>
|
|
762
|
+
<tr>
|
|
763
|
+
<td><code>{{entry.data.fieldName}}</code></td>
|
|
764
|
+
<td>A field value from the current entry</td>
|
|
765
|
+
</tr>
|
|
766
|
+
<tr>
|
|
767
|
+
<td><code>{{entry.id}}</code></td>
|
|
768
|
+
<td>The entry's ID</td>
|
|
769
|
+
</tr>
|
|
770
|
+
<tr>
|
|
771
|
+
<td><code>{{now}}</code></td>
|
|
772
|
+
<td>Current timestamp (ISO 8601)</td>
|
|
773
|
+
</tr>
|
|
774
|
+
<tr>
|
|
775
|
+
<td><code>{{user.name}}</code></td>
|
|
776
|
+
<td>Name of the user who triggered the action</td>
|
|
777
|
+
</tr>
|
|
778
|
+
<tr>
|
|
779
|
+
<td><code>{{user.email}}</code></td>
|
|
780
|
+
<td>Email of the triggering user</td>
|
|
781
|
+
</tr>
|
|
782
|
+
<tr>
|
|
783
|
+
<td><code>{{env.CMS_PUBLIC_*}}</code></td>
|
|
784
|
+
<td>Environment variables prefixed <code>CMS_PUBLIC_</code> only</td>
|
|
785
|
+
</tr>
|
|
786
|
+
</tbody>
|
|
787
|
+
</table>
|
|
788
|
+
<p><strong>Example</strong> — approve an application and notify by email:</p>
|
|
789
|
+
<pre class="code-block"><code>Step 1: updateField field=status value=approved
|
|
613
790
|
Step 2: updateField field=approvedAt value={{now}}
|
|
614
791
|
Step 3: email to={{entry.data.email}}
|
|
615
792
|
subject=Your application has been approved
|
|
616
793
|
template=Congratulations {{entry.data.name}}, your application is approved.</code></pre>
|
|
617
794
|
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
<
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
<
|
|
651
|
-
<
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
</tbody>
|
|
700
|
-
</table>
|
|
701
|
-
|
|
702
|
-
<h3>Collection Integration</h3>
|
|
703
|
-
<p>Add per-entry buttons to any <code>[collection]</code> shortcode:</p>
|
|
704
|
-
<pre class="code-block"><code>[collection slug="applications" display="cards" title-field="name"
|
|
795
|
+
<h3>Partial Execution</h3>
|
|
796
|
+
<p>Actions are <strong>not transactional</strong>. If a step fails, the action stops and returns the
|
|
797
|
+
number of steps completed so far (<code>stepsCompleted</code>). Steps that already ran are
|
|
798
|
+
<strong>not rolled back</strong>. Design step order with this in mind — put irreversible steps
|
|
799
|
+
(delete, email) last.</p>
|
|
800
|
+
|
|
801
|
+
<h3>After a deleteEntry step</h3>
|
|
802
|
+
<p>If an action contains a <code>deleteEntry</code> step, subsequent steps will fail because the entry
|
|
803
|
+
no longer exists. Place <code>deleteEntry</code> as the last step.</p>
|
|
804
|
+
</div>
|
|
805
|
+
|
|
806
|
+
<!-- CTA Shortcode -->
|
|
807
|
+
<div class="tab-panel docs-body">
|
|
808
|
+
<p>The <code>[cta]</code> shortcode places an action-trigger button in any public page. Clicking it
|
|
809
|
+
calls
|
|
810
|
+
<code>POST /api/actions/:slug/public</code> with the entry ID, using the logged-in user's JWT.
|
|
811
|
+
If the user is not logged in, a warning toast is shown instead.</p>
|
|
812
|
+
|
|
813
|
+
<h3>Syntax & Attributes</h3>
|
|
814
|
+
<p><strong>Wrapping form:</strong></p>
|
|
815
|
+
<pre class="code-block"><code>[cta action="slug" entry="entry-id" icon="check" confirm="Are you sure?"]Button label[/cta]</code></pre>
|
|
816
|
+
<p><strong>Self-closing form:</strong></p>
|
|
817
|
+
<pre class="code-block"><code>[cta action="slug" entry="entry-id" label="Button label" /]</code></pre>
|
|
818
|
+
<table class="table table-sm" style="margin-top:1rem;">
|
|
819
|
+
<thead>
|
|
820
|
+
<tr>
|
|
821
|
+
<th>Attribute</th>
|
|
822
|
+
<th>Required</th>
|
|
823
|
+
<th>Default</th>
|
|
824
|
+
<th>Description</th>
|
|
825
|
+
</tr>
|
|
826
|
+
</thead>
|
|
827
|
+
<tbody>
|
|
828
|
+
<tr>
|
|
829
|
+
<td><code>action</code></td>
|
|
830
|
+
<td>Yes</td>
|
|
831
|
+
<td>—</td>
|
|
832
|
+
<td>Action slug</td>
|
|
833
|
+
</tr>
|
|
834
|
+
<tr>
|
|
835
|
+
<td><code>entry</code></td>
|
|
836
|
+
<td>Yes</td>
|
|
837
|
+
<td>—</td>
|
|
838
|
+
<td>Entry UUID to act on</td>
|
|
839
|
+
</tr>
|
|
840
|
+
<tr>
|
|
841
|
+
<td><code>label</code></td>
|
|
842
|
+
<td>No</td>
|
|
843
|
+
<td><code>"Run"</code></td>
|
|
844
|
+
<td>Button text (self-closing only)</td>
|
|
845
|
+
</tr>
|
|
846
|
+
<tr>
|
|
847
|
+
<td><code>style</code></td>
|
|
848
|
+
<td>No</td>
|
|
849
|
+
<td><code>"primary"</code></td>
|
|
850
|
+
<td>primary · secondary · ghost · danger</td>
|
|
851
|
+
</tr>
|
|
852
|
+
<tr>
|
|
853
|
+
<td><code>icon</code></td>
|
|
854
|
+
<td>No</td>
|
|
855
|
+
<td>—</td>
|
|
856
|
+
<td>Domma icon name</td>
|
|
857
|
+
</tr>
|
|
858
|
+
<tr>
|
|
859
|
+
<td><code>size</code></td>
|
|
860
|
+
<td>No</td>
|
|
861
|
+
<td>—</td>
|
|
862
|
+
<td>sm · md · lg</td>
|
|
863
|
+
</tr>
|
|
864
|
+
<tr>
|
|
865
|
+
<td><code>confirm</code></td>
|
|
866
|
+
<td>No</td>
|
|
867
|
+
<td>—</td>
|
|
868
|
+
<td>Confirmation prompt before executing</td>
|
|
869
|
+
</tr>
|
|
870
|
+
</tbody>
|
|
871
|
+
</table>
|
|
872
|
+
|
|
873
|
+
<h3>Collection Integration</h3>
|
|
874
|
+
<p>Add per-entry buttons to any <code>[collection]</code> shortcode:</p>
|
|
875
|
+
<pre class="code-block"><code>[collection slug="applications" display="cards" title-field="name"
|
|
705
876
|
cta="approve-application"
|
|
706
877
|
cta-label="Approve"
|
|
707
878
|
cta-icon="check"
|
|
708
879
|
cta-style="primary"
|
|
709
880
|
cta-confirm="Approve this application?" /]</code></pre>
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
881
|
+
<table class="table table-sm" style="margin-top:1rem;">
|
|
882
|
+
<thead>
|
|
883
|
+
<tr>
|
|
884
|
+
<th>Attribute</th>
|
|
885
|
+
<th>Default</th>
|
|
886
|
+
<th>Description</th>
|
|
887
|
+
</tr>
|
|
888
|
+
</thead>
|
|
889
|
+
<tbody>
|
|
890
|
+
<tr>
|
|
891
|
+
<td><code>cta</code></td>
|
|
892
|
+
<td>—</td>
|
|
893
|
+
<td>Action slug — enables per-entry buttons</td>
|
|
894
|
+
</tr>
|
|
895
|
+
<tr>
|
|
896
|
+
<td><code>cta-label</code></td>
|
|
897
|
+
<td><code>"Run"</code></td>
|
|
898
|
+
<td>Button label</td>
|
|
899
|
+
</tr>
|
|
900
|
+
<tr>
|
|
901
|
+
<td><code>cta-icon</code></td>
|
|
902
|
+
<td>—</td>
|
|
903
|
+
<td>Domma icon name</td>
|
|
904
|
+
</tr>
|
|
905
|
+
<tr>
|
|
906
|
+
<td><code>cta-style</code></td>
|
|
907
|
+
<td><code>"primary"</code></td>
|
|
908
|
+
<td>Button variant</td>
|
|
909
|
+
</tr>
|
|
910
|
+
<tr>
|
|
911
|
+
<td><code>cta-confirm</code></td>
|
|
912
|
+
<td>—</td>
|
|
913
|
+
<td>Confirmation prompt</td>
|
|
914
|
+
</tr>
|
|
915
|
+
</tbody>
|
|
916
|
+
</table>
|
|
917
|
+
<p>All three display modes support CTA buttons: <strong>cards</strong> (card footer),
|
|
918
|
+
<strong>list</strong> (inline), <strong>table</strong> (dedicated column).</p>
|
|
919
|
+
</div>
|
|
920
|
+
|
|
748
921
|
</div>
|
|
749
922
|
</div>
|
|
750
923
|
|