domma-cms 1.66.8 → 1.66.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/CHANGELOG.md +14 -0
- package/admin/css/admin.css +1 -1
- package/admin/js/app.js +2 -2
- package/admin/js/lib/page-editor-reference.js +1 -1
- package/admin/js/templates/docs/usage-shortcodes-components.html +366 -0
- package/admin/js/templates/docs/usage-shortcodes-content.html +550 -0
- package/admin/js/templates/docs/usage-shortcodes-data.html +469 -0
- package/admin/js/templates/docs/usage-shortcodes-effects.html +897 -0
- package/admin/js/templates/docs/usage-shortcodes-layout.html +732 -0
- package/admin/js/templates/docs/usage-shortcodes.html +82 -0
- package/admin/js/templates/documentation.html +20 -0
- package/admin/js/templates/effects.html +1 -1
- package/admin/js/views/doc-pages.js +1 -1
- package/admin/js/views/index.js +1 -1
- package/docs/markdown-shortcodes.md +15 -10
- package/package.json +1 -1
- package/public/css/site.css +1 -1
- package/public/js/effects.js +1 -1
- package/server/server.js +5 -0
- package/server/services/docs.js +5 -0
- package/server/services/markdown.js +104 -34
- package/server/templates/page.html +2 -2
|
@@ -0,0 +1,469 @@
|
|
|
1
|
+
<div class="view-header">
|
|
2
|
+
<h1><span data-icon="database"></span> Data shortcodes</h1>
|
|
3
|
+
<a href="#/docs/usage/shortcodes" class="btn btn-ghost btn-sm"><span data-icon="arrow-left"></span> Shortcodes</a>
|
|
4
|
+
</div>
|
|
5
|
+
|
|
6
|
+
<div class="row">
|
|
7
|
+
<div class="col-12">
|
|
8
|
+
<div class="docs-body">
|
|
9
|
+
|
|
10
|
+
<p>These shortcodes show things you keep elsewhere in the admin: the entries of a collection, a saved view, a form, a block, a component, a button that runs an Action. Each one has its own section below, with an example to copy and every attribute it takes.</p>
|
|
11
|
+
<h3 id="sc-collection"><code>collection</code> - the entries of a collection</h3>
|
|
12
|
+
<p>Shows the entries of a collection on a page - as a table, cards, a list, an accordion, a timeline, a carousel, a list group, or through a block of your own design.</p>
|
|
13
|
+
<pre><code>[collection slug="team" display="cards" columns="3" title-field="name" /]
|
|
14
|
+
[collection slug="products" display="list" limit="10" sort="price" order="asc" /]
|
|
15
|
+
[collection slug="jobs" where_location="London" where_salary_gte="50000" /]
|
|
16
|
+
[collection slug="applications" scope="mine" display="cards" /]
|
|
17
|
+
</code></pre>
|
|
18
|
+
<p><strong>Before it shows anything</strong>, the collection has to be allowed on pages: open the collection, go to <strong>API & Export</strong>, and switch on <strong>Show on pages</strong>. That is already on for a collection you made to hold content. It is off for a Tool's collection, a built-in one, and one that stores a form's submissions, until you switch it on. A tag for a collection that is off shows nothing (the editor's preview says why).</p>
|
|
19
|
+
<p>The attributes every display takes:</p>
|
|
20
|
+
<table class="table table-sm">
|
|
21
|
+
<thead>
|
|
22
|
+
<tr>
|
|
23
|
+
<th>Attribute</th>
|
|
24
|
+
<th>What it does</th>
|
|
25
|
+
</tr>
|
|
26
|
+
</thead>
|
|
27
|
+
<tbody><tr>
|
|
28
|
+
<td><code>slug</code></td>
|
|
29
|
+
<td>Which collection. Required</td>
|
|
30
|
+
</tr>
|
|
31
|
+
<tr>
|
|
32
|
+
<td><code>display</code></td>
|
|
33
|
+
<td><code>table</code>, <code>cards</code>, <code>list</code>, <code>accordion</code>, <code>timeline</code>, <code>carousel</code>, <code>listgroup</code> or <code>block</code>. Without it: a table, or cards when visitors can search, sort or filter (below)</td>
|
|
34
|
+
</tr>
|
|
35
|
+
<tr>
|
|
36
|
+
<td><code>fields</code></td>
|
|
37
|
+
<td>Which fields to show, comma separated. Without it, all of them except fields marked as not shown in lists</td>
|
|
38
|
+
</tr>
|
|
39
|
+
<tr>
|
|
40
|
+
<td><code>limit</code></td>
|
|
41
|
+
<td>The most entries to show</td>
|
|
42
|
+
</tr>
|
|
43
|
+
<tr>
|
|
44
|
+
<td><code>sort</code></td>
|
|
45
|
+
<td>The field to sort by (default: newest first)</td>
|
|
46
|
+
</tr>
|
|
47
|
+
<tr>
|
|
48
|
+
<td><code>order</code></td>
|
|
49
|
+
<td><code>asc</code> or <code>desc</code></td>
|
|
50
|
+
</tr>
|
|
51
|
+
<tr>
|
|
52
|
+
<td><code>empty</code></td>
|
|
53
|
+
<td>Words to show when there are no entries</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr>
|
|
56
|
+
<td><code>where_<field></code></td>
|
|
57
|
+
<td>Show only matching entries - see "Showing only some entries" below</td>
|
|
58
|
+
</tr>
|
|
59
|
+
<tr>
|
|
60
|
+
<td><code>scope</code></td>
|
|
61
|
+
<td><code>mine</code> shows a signed-in visitor only the entries they created</td>
|
|
62
|
+
</tr>
|
|
63
|
+
<tr>
|
|
64
|
+
<td><code>class</code></td>
|
|
65
|
+
<td>Your own CSS class on the whole display</td>
|
|
66
|
+
</tr>
|
|
67
|
+
<tr>
|
|
68
|
+
<td><code>item-class</code></td>
|
|
69
|
+
<td>Your own CSS class on every entry (not table rows)</td>
|
|
70
|
+
</tr>
|
|
71
|
+
<tr>
|
|
72
|
+
<td><code>id</code></td>
|
|
73
|
+
<td>Your own id</td>
|
|
74
|
+
</tr>
|
|
75
|
+
</tbody></table>
|
|
76
|
+
<h4>The displays</h4>
|
|
77
|
+
<table class="table table-sm">
|
|
78
|
+
<thead>
|
|
79
|
+
<tr>
|
|
80
|
+
<th>Display</th>
|
|
81
|
+
<th>Extra attributes</th>
|
|
82
|
+
</tr>
|
|
83
|
+
</thead>
|
|
84
|
+
<tbody><tr>
|
|
85
|
+
<td><code>table</code></td>
|
|
86
|
+
<td><code>search</code>, <code>sortable</code> (both on unless set to <code>false</code>), <code>exportable</code> (<code>true</code> adds a CSV button), <code>page-size</code> (rows per page, default 25)</td>
|
|
87
|
+
</tr>
|
|
88
|
+
<tr>
|
|
89
|
+
<td><code>cards</code></td>
|
|
90
|
+
<td><code>title-field</code> (the field used as each card's title), <code>columns</code> (2-4, default 3)</td>
|
|
91
|
+
</tr>
|
|
92
|
+
<tr>
|
|
93
|
+
<td><code>list</code></td>
|
|
94
|
+
<td><code>title-field</code></td>
|
|
95
|
+
</tr>
|
|
96
|
+
<tr>
|
|
97
|
+
<td><code>accordion</code></td>
|
|
98
|
+
<td><code>title-field</code>, <code>body-field</code>, and <code>multiple="true"</code> to let several stay open</td>
|
|
99
|
+
</tr>
|
|
100
|
+
<tr>
|
|
101
|
+
<td><code>timeline</code></td>
|
|
102
|
+
<td><code>title-field</code>, <code>date-field</code>, <code>status-field</code>, <code>icon-field</code>, <code>body-field</code>, and <code>layout</code>, <code>theme</code>, <code>mode</code> as on <code>[timeline]</code></td>
|
|
103
|
+
</tr>
|
|
104
|
+
<tr>
|
|
105
|
+
<td><code>carousel</code></td>
|
|
106
|
+
<td><code>image-field</code>, <code>title-field</code>, <code>body-field</code>, and the <code>[carousel]</code> attributes (<code>autoplay</code>, <code>interval</code>, <code>animation</code>, <code>height</code> and the rest)</td>
|
|
107
|
+
</tr>
|
|
108
|
+
<tr>
|
|
109
|
+
<td><code>listgroup</code></td>
|
|
110
|
+
<td><code>title-field</code>, <code>body-field</code>, and <code>variant</code>, <code>size</code>, <code>itemvariant</code>, <code>action</code> as on <code>[listgroup]</code></td>
|
|
111
|
+
</tr>
|
|
112
|
+
<tr>
|
|
113
|
+
<td><code>block</code></td>
|
|
114
|
+
<td><code>block</code> - the name of the block that draws each entry - and <code>cols</code> for how many across. Carousel and list group take <code>block</code> too</td>
|
|
115
|
+
</tr>
|
|
116
|
+
</tbody></table>
|
|
117
|
+
<pre><code>[collection slug="events" display="timeline" title-field="title" date-field="date" body-field="summary" /]
|
|
118
|
+
[collection slug="testimonials" display="carousel" image-field="photo" title-field="name" body-field="quote" autoplay="true" /]
|
|
119
|
+
[collection slug="team" display="block" block="profile-card" /]
|
|
120
|
+
</code></pre>
|
|
121
|
+
<p>Designing a block for entries is covered in <a href="#/docs/usage/blocks">Blocks</a>.</p>
|
|
122
|
+
<h4>Showing only some entries</h4>
|
|
123
|
+
<p>Add <code>where_</code> and a field name to keep only the entries that match. A word after the field name changes the comparison:</p>
|
|
124
|
+
<table class="table table-sm">
|
|
125
|
+
<thead>
|
|
126
|
+
<tr>
|
|
127
|
+
<th>Written as</th>
|
|
128
|
+
<th>Keeps entries where</th>
|
|
129
|
+
</tr>
|
|
130
|
+
</thead>
|
|
131
|
+
<tbody><tr>
|
|
132
|
+
<td><code>where_location="London"</code></td>
|
|
133
|
+
<td>the field equals the value</td>
|
|
134
|
+
</tr>
|
|
135
|
+
<tr>
|
|
136
|
+
<td><code>where_status_ne="closed"</code></td>
|
|
137
|
+
<td>it does not equal the value</td>
|
|
138
|
+
</tr>
|
|
139
|
+
<tr>
|
|
140
|
+
<td><code>where_salary_gt="40000"</code>, <code>where_salary_gte="50000"</code></td>
|
|
141
|
+
<td>it is greater than / at least the value</td>
|
|
142
|
+
</tr>
|
|
143
|
+
<tr>
|
|
144
|
+
<td><code>where_salary_lt="100000"</code>, <code>where_date_lte="2026-06-01"</code></td>
|
|
145
|
+
<td>it is less than / at most the value</td>
|
|
146
|
+
</tr>
|
|
147
|
+
<tr>
|
|
148
|
+
<td><code>where_type_in="full-time,contract"</code></td>
|
|
149
|
+
<td>it is one of the listed values</td>
|
|
150
|
+
</tr>
|
|
151
|
+
<tr>
|
|
152
|
+
<td><code>where_status_nin="archived,withdrawn"</code></td>
|
|
153
|
+
<td>it is none of the listed values</td>
|
|
154
|
+
</tr>
|
|
155
|
+
<tr>
|
|
156
|
+
<td><code>where_title_contains="engineer"</code></td>
|
|
157
|
+
<td>it contains the words (capitals ignored)</td>
|
|
158
|
+
</tr>
|
|
159
|
+
<tr>
|
|
160
|
+
<td><code>where_title_starts="Senior"</code>, <code>where_email_ends="@example.com"</code></td>
|
|
161
|
+
<td>it starts / ends with the words</td>
|
|
162
|
+
</tr>
|
|
163
|
+
<tr>
|
|
164
|
+
<td><code>where_remote_exists="true"</code></td>
|
|
165
|
+
<td>the field has a value</td>
|
|
166
|
+
</tr>
|
|
167
|
+
</tbody></table>
|
|
168
|
+
<p>Several <code>where_</code> attributes all have to match. For "this or that", build a View and show it with <code>[view]</code>.</p>
|
|
169
|
+
<h4>Letting visitors search, sort and filter</h4>
|
|
170
|
+
<p>Add any of these and the display becomes a browser, with a search box, a sort menu, filters and pages:</p>
|
|
171
|
+
<pre><code>[collection slug="jobs" display="cards" columns="3"
|
|
172
|
+
searchable
|
|
173
|
+
filterable="location,type,salary"
|
|
174
|
+
sortable
|
|
175
|
+
page-size="9"
|
|
176
|
+
empty="No matching jobs." /]
|
|
177
|
+
</code></pre>
|
|
178
|
+
<table class="table table-sm">
|
|
179
|
+
<thead>
|
|
180
|
+
<tr>
|
|
181
|
+
<th>Attribute</th>
|
|
182
|
+
<th>What it does</th>
|
|
183
|
+
</tr>
|
|
184
|
+
</thead>
|
|
185
|
+
<tbody><tr>
|
|
186
|
+
<td><code>searchable</code></td>
|
|
187
|
+
<td>Switch: a search box</td>
|
|
188
|
+
</tr>
|
|
189
|
+
<tr>
|
|
190
|
+
<td><code>sortable</code></td>
|
|
191
|
+
<td>Switch: a sort menu over every field, or <code>sortable="title,salary"</code> to offer only those</td>
|
|
192
|
+
</tr>
|
|
193
|
+
<tr>
|
|
194
|
+
<td><code>filterable</code></td>
|
|
195
|
+
<td>The fields to offer as filters, comma separated. The control suits the field: a text box, a from-and-to pair for numbers and dates, a pick list for choices</td>
|
|
196
|
+
</tr>
|
|
197
|
+
<tr>
|
|
198
|
+
<td><code>paginate</code></td>
|
|
199
|
+
<td>Switch: pages, without the rest</td>
|
|
200
|
+
</tr>
|
|
201
|
+
<tr>
|
|
202
|
+
<td><code>pagination</code></td>
|
|
203
|
+
<td><code>pages</code> (default) or <code>scroll</code> (more entries load as the visitor scrolls)</td>
|
|
204
|
+
</tr>
|
|
205
|
+
<tr>
|
|
206
|
+
<td><code>page-size</code></td>
|
|
207
|
+
<td>Entries per page (default 12)</td>
|
|
208
|
+
</tr>
|
|
209
|
+
<tr>
|
|
210
|
+
<td><code>mode</code></td>
|
|
211
|
+
<td><code>client</code> (default; all entries are sent with the page) or <code>server</code> (each page is fetched as needed - for large collections)</td>
|
|
212
|
+
</tr>
|
|
213
|
+
<tr>
|
|
214
|
+
<td><code>exportable</code></td>
|
|
215
|
+
<td>Switch: an Export CSV button</td>
|
|
216
|
+
</tr>
|
|
217
|
+
<tr>
|
|
218
|
+
<td><code>no-saved-searches</code></td>
|
|
219
|
+
<td>Switch: hide the saved-searches menu</td>
|
|
220
|
+
</tr>
|
|
221
|
+
<tr>
|
|
222
|
+
<td><code>no-url-sync</code></td>
|
|
223
|
+
<td>Switch: do not keep the visitor's choices in the page address</td>
|
|
224
|
+
</tr>
|
|
225
|
+
<tr>
|
|
226
|
+
<td><code>transitions</code></td>
|
|
227
|
+
<td>Switch: each entry shows buttons for the Actions that can move it to its next state</td>
|
|
228
|
+
</tr>
|
|
229
|
+
</tbody></table>
|
|
230
|
+
<p>A <code>where_</code> filter you write always applies; visitors can narrow within it but never see past it.</p>
|
|
231
|
+
<p>Whatever the display, a visitor can also right-click an entry to filter, search, sort, group, copy, export or print what is shown, and copy a link to that exact view.</p>
|
|
232
|
+
<h4>A visitor's own entries</h4>
|
|
233
|
+
<p><code>scope="mine"</code> shows a signed-in visitor only the entries they created - "My applications", "My orders". Visitors who are not signed in are asked to sign in.</p>
|
|
234
|
+
<pre><code>[collection slug="applications" scope="mine" display="cards" title-field="jobTitle" /]
|
|
235
|
+
</code></pre>
|
|
236
|
+
<h4>A button on every entry</h4>
|
|
237
|
+
<p>On the table, cards, list and block displays, each entry can carry a button that runs an Action:</p>
|
|
238
|
+
<table class="table table-sm">
|
|
239
|
+
<thead>
|
|
240
|
+
<tr>
|
|
241
|
+
<th>Attribute</th>
|
|
242
|
+
<th>What it does</th>
|
|
243
|
+
</tr>
|
|
244
|
+
</thead>
|
|
245
|
+
<tbody><tr>
|
|
246
|
+
<td><code>cta</code></td>
|
|
247
|
+
<td>The Action to run for that entry</td>
|
|
248
|
+
</tr>
|
|
249
|
+
<tr>
|
|
250
|
+
<td><code>cta-label</code></td>
|
|
251
|
+
<td>The words on the button (default "Run")</td>
|
|
252
|
+
</tr>
|
|
253
|
+
<tr>
|
|
254
|
+
<td><code>cta-icon</code>, <code>cta-style</code></td>
|
|
255
|
+
<td>Its icon and colour</td>
|
|
256
|
+
</tr>
|
|
257
|
+
<tr>
|
|
258
|
+
<td><code>cta-confirm</code></td>
|
|
259
|
+
<td>A question to ask before running</td>
|
|
260
|
+
</tr>
|
|
261
|
+
</tbody></table>
|
|
262
|
+
<h3 id="sc-view"><code>view</code> - a saved View</h3>
|
|
263
|
+
<p>Shows a saved View - a query you built under <strong>Views</strong> that can join, filter and group collections. It takes the same displays as <code>[collection]</code>.</p>
|
|
264
|
+
<pre><code>[view slug="products" display="table" limit="50" /]
|
|
265
|
+
[view slug="team" display="cards" columns="3" title-field="name" /]
|
|
266
|
+
[view slug="employer-applications" display="table" searchable sortable page-size="20" /]
|
|
267
|
+
</code></pre>
|
|
268
|
+
<table class="table table-sm">
|
|
269
|
+
<thead>
|
|
270
|
+
<tr>
|
|
271
|
+
<th>Attribute</th>
|
|
272
|
+
<th>What it does</th>
|
|
273
|
+
</tr>
|
|
274
|
+
</thead>
|
|
275
|
+
<tbody><tr>
|
|
276
|
+
<td><code>slug</code></td>
|
|
277
|
+
<td>Which View. Required</td>
|
|
278
|
+
</tr>
|
|
279
|
+
<tr>
|
|
280
|
+
<td><code>display</code></td>
|
|
281
|
+
<td><code>table</code>, <code>cards</code>, <code>list</code>, <code>accordion</code>, <code>timeline</code>, <code>carousel</code>, <code>listgroup</code> or <code>block</code>. Without it, the display saved on the View</td>
|
|
282
|
+
</tr>
|
|
283
|
+
<tr>
|
|
284
|
+
<td><code>limit</code></td>
|
|
285
|
+
<td>The most entries to show (default 25)</td>
|
|
286
|
+
</tr>
|
|
287
|
+
<tr>
|
|
288
|
+
<td><code>fields</code></td>
|
|
289
|
+
<td>Which fields to show, comma separated</td>
|
|
290
|
+
</tr>
|
|
291
|
+
<tr>
|
|
292
|
+
<td><code>title-field</code></td>
|
|
293
|
+
<td>The field used as each card's or row's title</td>
|
|
294
|
+
</tr>
|
|
295
|
+
<tr>
|
|
296
|
+
<td><code>columns</code></td>
|
|
297
|
+
<td>For cards: 2-4 (default 3)</td>
|
|
298
|
+
</tr>
|
|
299
|
+
<tr>
|
|
300
|
+
<td><code>empty</code></td>
|
|
301
|
+
<td>Words to show when there are no entries</td>
|
|
302
|
+
</tr>
|
|
303
|
+
<tr>
|
|
304
|
+
<td><code>block</code></td>
|
|
305
|
+
<td>The block that draws each entry</td>
|
|
306
|
+
</tr>
|
|
307
|
+
<tr>
|
|
308
|
+
<td><code>action</code></td>
|
|
309
|
+
<td>An Action to run from a button on every entry, styled with <code>cta-label</code>, <code>cta-style</code>, <code>cta-icon</code>, <code>cta-confirm</code></td>
|
|
310
|
+
</tr>
|
|
311
|
+
<tr>
|
|
312
|
+
<td><code>class</code>, <code>item-class</code></td>
|
|
313
|
+
<td>Your own CSS class on the display / on every entry</td>
|
|
314
|
+
</tr>
|
|
315
|
+
</tbody></table>
|
|
316
|
+
<p>The attributes for each display are the same as on <code>[collection]</code>. <code>searchable</code>, <code>sortable</code>, <code>filterable</code> and <code>paginate</code> work too, and switch the display to cards unless you or the View say otherwise.</p>
|
|
317
|
+
<p>Views are explained in <a href="#/docs/usage/views">Views</a>.</p>
|
|
318
|
+
<h3 id="sc-block"><code>block</code> - one of your blocks</h3>
|
|
319
|
+
<p>Puts one of your blocks on a page, filling its placeholders with the values you write.</p>
|
|
320
|
+
<pre><code>[block template="contact-card" full_name="Jane Doe" phone_number="555-1234" /]
|
|
321
|
+
</code></pre>
|
|
322
|
+
<p>Every block can also be written with its own name as the tag. These two are the same:</p>
|
|
323
|
+
<pre><code>[block template="contact-card" full_name="Jane Doe" /]
|
|
324
|
+
[contact-card full_name="Jane Doe" /]
|
|
325
|
+
</code></pre>
|
|
326
|
+
<table class="table table-sm">
|
|
327
|
+
<thead>
|
|
328
|
+
<tr>
|
|
329
|
+
<th>Attribute</th>
|
|
330
|
+
<th>What it does</th>
|
|
331
|
+
</tr>
|
|
332
|
+
</thead>
|
|
333
|
+
<tbody><tr>
|
|
334
|
+
<td><code>template</code></td>
|
|
335
|
+
<td>The block's name. Required in the <code>[block …]</code> form</td>
|
|
336
|
+
</tr>
|
|
337
|
+
<tr>
|
|
338
|
+
<td>anything else</td>
|
|
339
|
+
<td>A value for the placeholder of that name: <code>full_name="Jane Doe"</code> fills <code>{{full_name}}</code></td>
|
|
340
|
+
</tr>
|
|
341
|
+
<tr>
|
|
342
|
+
<td><code>class</code>, <code>id</code></td>
|
|
343
|
+
<td>Your own CSS class or id on the block's wrapper</td>
|
|
344
|
+
</tr>
|
|
345
|
+
</tbody></table>
|
|
346
|
+
<p>A block that has slots can hold content of its own. Write it as a pair, with the content between the tags, and <code>[slot name="…"]</code> for a named slot:</p>
|
|
347
|
+
<pre><code>[domma-block-cushion-card heading="Your heading"]
|
|
348
|
+
**Body content**, with any shortcodes you like.
|
|
349
|
+
[slot name="footer"]
|
|
350
|
+
[button href="/contact"]Contact us[/button]
|
|
351
|
+
[/slot]
|
|
352
|
+
[/domma-block-cushion-card]
|
|
353
|
+
</code></pre>
|
|
354
|
+
<p>Good to know:</p>
|
|
355
|
+
<ul>
|
|
356
|
+
<li>A block named the same as a built-in shortcode (<code>card</code>, <code>menu</code>) can only be used through <code>[block template="…"]</code>.</li>
|
|
357
|
+
<li>A placeholder you give no value for is left empty. A block that does not exist shows nothing.</li>
|
|
358
|
+
<li>In the editor, right-click and choose <strong>Add block…</strong> to insert a block with all its parameters written out. Right-click inside a block's tag to fill them in, or <strong>Edit the block</strong> to open it in its own tab.</li>
|
|
359
|
+
<li>Blocks are made under <strong>Blocks</strong> in the sidebar - see <a href="#/docs/usage/blocks">Blocks</a>.</li>
|
|
360
|
+
</ul>
|
|
361
|
+
<h3 id="sc-component"><code>component</code> - one of your components</h3>
|
|
362
|
+
<p>Puts one of your components on a page. Components are small interactive pieces made under <strong>Components</strong> in the sidebar.</p>
|
|
363
|
+
<pre><code>[component name="counter" initial="5" /]
|
|
364
|
+
</code></pre>
|
|
365
|
+
<table class="table table-sm">
|
|
366
|
+
<thead>
|
|
367
|
+
<tr>
|
|
368
|
+
<th>Attribute</th>
|
|
369
|
+
<th>What it does</th>
|
|
370
|
+
</tr>
|
|
371
|
+
</thead>
|
|
372
|
+
<tbody><tr>
|
|
373
|
+
<td><code>name</code></td>
|
|
374
|
+
<td>The component's name. Required</td>
|
|
375
|
+
</tr>
|
|
376
|
+
<tr>
|
|
377
|
+
<td>anything else</td>
|
|
378
|
+
<td>Passed to the component as a setting</td>
|
|
379
|
+
</tr>
|
|
380
|
+
</tbody></table>
|
|
381
|
+
<p>A component can be written inside any container. A tag for a component that does not exist shows nothing. See <a href="#/docs/components">Components Reference</a>.</p>
|
|
382
|
+
<h3 id="sc-form"><code>form</code> - one of your forms</h3>
|
|
383
|
+
<p>Puts one of your forms on a page.</p>
|
|
384
|
+
<pre><code>[form name="contact" /]
|
|
385
|
+
[form name="newsletter" class="mt-4" /]
|
|
386
|
+
</code></pre>
|
|
387
|
+
<table class="table table-sm">
|
|
388
|
+
<thead>
|
|
389
|
+
<tr>
|
|
390
|
+
<th>Attribute</th>
|
|
391
|
+
<th>What it does</th>
|
|
392
|
+
</tr>
|
|
393
|
+
</thead>
|
|
394
|
+
<tbody><tr>
|
|
395
|
+
<td><code>name</code> (or <code>slug</code>)</td>
|
|
396
|
+
<td>Which form. Required</td>
|
|
397
|
+
</tr>
|
|
398
|
+
<tr>
|
|
399
|
+
<td><code>class</code>, <code>id</code></td>
|
|
400
|
+
<td>Your own CSS class or id on this placement</td>
|
|
401
|
+
</tr>
|
|
402
|
+
</tbody></table>
|
|
403
|
+
<p>Forms are built under <strong>Forms</strong> in the sidebar - see <a href="#/docs/usage/collections">Collections & Forms</a>.</p>
|
|
404
|
+
<h3 id="sc-cta"><code>cta</code> - a button that runs an Action</h3>
|
|
405
|
+
<p>A button that runs an Action - send an email, change an entry, call a webhook - rather than opening a page.</p>
|
|
406
|
+
<pre><code>[cta action="send-welcome" entry="abc123" style="primary" icon="mail"]Send welcome email[/cta]
|
|
407
|
+
[cta action="archive" entry="abc123" confirm="Archive this record?" label="Archive" /]
|
|
408
|
+
</code></pre>
|
|
409
|
+
<table class="table table-sm">
|
|
410
|
+
<thead>
|
|
411
|
+
<tr>
|
|
412
|
+
<th>Attribute</th>
|
|
413
|
+
<th>What it does</th>
|
|
414
|
+
</tr>
|
|
415
|
+
</thead>
|
|
416
|
+
<tbody><tr>
|
|
417
|
+
<td><code>action</code></td>
|
|
418
|
+
<td>Which Action to run. Required</td>
|
|
419
|
+
</tr>
|
|
420
|
+
<tr>
|
|
421
|
+
<td><code>entry</code></td>
|
|
422
|
+
<td>The entry to run it on</td>
|
|
423
|
+
</tr>
|
|
424
|
+
<tr>
|
|
425
|
+
<td><code>label</code></td>
|
|
426
|
+
<td>The words on the button, for the self-closing form</td>
|
|
427
|
+
</tr>
|
|
428
|
+
<tr>
|
|
429
|
+
<td><code>style</code></td>
|
|
430
|
+
<td>The button's colour, as on <code>[button]</code></td>
|
|
431
|
+
</tr>
|
|
432
|
+
<tr>
|
|
433
|
+
<td><code>icon</code></td>
|
|
434
|
+
<td>An icon before the words</td>
|
|
435
|
+
</tr>
|
|
436
|
+
<tr>
|
|
437
|
+
<td><code>size</code></td>
|
|
438
|
+
<td><code>sm</code> or <code>lg</code></td>
|
|
439
|
+
</tr>
|
|
440
|
+
<tr>
|
|
441
|
+
<td><code>confirm</code></td>
|
|
442
|
+
<td>A question to ask before running</td>
|
|
443
|
+
</tr>
|
|
444
|
+
</tbody></table>
|
|
445
|
+
<p>There is more in <a href="#/docs/usage/cta-shortcode">CTA Shortcode</a> and <a href="#/docs/usage/actions">Actions</a>.</p>
|
|
446
|
+
<h3 id="sc-dconfig"><code>dconfig</code> - page behaviour without a script</h3>
|
|
447
|
+
<p>Makes parts of a page react to clicks without writing a script - show a panel when a button is pressed, for example. Between the tags goes a description of what should happen, written as JSON.</p>
|
|
448
|
+
<pre><code>[dconfig]
|
|
449
|
+
{
|
|
450
|
+
"#my-button": {
|
|
451
|
+
"events": {
|
|
452
|
+
"click": { "target": "#my-panel", "toggleClass": "hidden" }
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
[/dconfig]
|
|
457
|
+
</code></pre>
|
|
458
|
+
<p>This makes a click on the element with the id <code>my-button</code> show or hide the element with the id <code>my-panel</code>.</p>
|
|
459
|
+
<p>Good to know:</p>
|
|
460
|
+
<ul>
|
|
461
|
+
<li>It takes no attributes, and draws nothing on the page.</li>
|
|
462
|
+
<li>A page can have several; they are combined.</li>
|
|
463
|
+
<li>JSON with a mistake in it is ignored. The page editor's <strong>DConfig</strong> tab points out misspelt names and wrong values before you save.</li>
|
|
464
|
+
<li>The same settings can be kept in the page editor's DConfig tab instead of in the text. The full guide is in <a href="#/docs/usage/dconfig">DConfig</a>.</li>
|
|
465
|
+
</ul>
|
|
466
|
+
|
|
467
|
+
</div>
|
|
468
|
+
</div>
|
|
469
|
+
</div>
|