Skip to content

Commit bfc4cda

Browse files
committed
updated block variations
1 parent 3086171 commit bfc4cda

File tree

7 files changed

+57
-207
lines changed

7 files changed

+57
-207
lines changed

component-definition.json

Lines changed: 6 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -98,24 +98,6 @@
9898
}
9999
}
100100
},
101-
{
102-
"title": "Card Item (no image)",
103-
"id": "cards-item-noimage",
104-
"model": "cards-item-noimage",
105-
"plugins": {
106-
"da": {
107-
"name": "cards-item-noimage",
108-
"rows": 1,
109-
"columns": 1,
110-
"fields": [
111-
{
112-
"name": "text",
113-
"selector": "div:nth-child(1)"
114-
}
115-
]
116-
}
117-
}
118-
},
119101
{
120102
"title": "Columns",
121103
"id": "columns",
@@ -155,7 +137,7 @@
155137
}
156138
},
157139
{
158-
"title": "Embed (with placeholder)",
140+
"title": "Embed",
159141
"id": "embed",
160142
"model": "embed",
161143
"plugins": {
@@ -184,28 +166,6 @@
184166
}
185167
}
186168
},
187-
{
188-
"title": "Embed (no placeholder)",
189-
"id": "embed-no-placeholder",
190-
"model": "embed-no-placeholder",
191-
"plugins": {
192-
"da": {
193-
"name": "embed",
194-
"rows": 1,
195-
"columns": 1,
196-
"fields": [
197-
{
198-
"name": "embedUrl",
199-
"selector": "div>div>p>a[href]"
200-
},
201-
{
202-
"name": "embedUrlText",
203-
"selector": "div>div>p>a"
204-
}
205-
]
206-
}
207-
}
208-
},
209169
{
210170
"title": "Form",
211171
"id": "form",
@@ -332,7 +292,7 @@
332292
}
333293
},
334294
{
335-
"title": "Related Articles (dynamic)",
295+
"title": "Related Articles",
336296
"id": "related-articles",
337297
"model": "related-articles",
338298
"plugins": {
@@ -341,6 +301,10 @@
341301
"rows": 2,
342302
"columns": 2,
343303
"fields": [
304+
{
305+
"name": "links",
306+
"selector": "div:nth-child(1)>div:nth-child(1)>ul"
307+
},
344308
{
345309
"name": "keywords",
346310
"selector": "div:nth-child(1)>div:nth-child(2)"
@@ -353,24 +317,6 @@
353317
}
354318
}
355319
},
356-
{
357-
"title": "Related Articles (links)",
358-
"id": "related-articles-links",
359-
"model": "related-articles-links",
360-
"plugins": {
361-
"da": {
362-
"name": "related-articles",
363-
"rows": 1,
364-
"columns": 1,
365-
"fields": [
366-
{
367-
"name": "links",
368-
"selector": "div>div>ul"
369-
}
370-
]
371-
}
372-
}
373-
},
374320
{
375321
"title": "Search",
376322
"id": "search",

component-filters.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,15 @@
1010
"components": [
1111
"cards",
1212
"cards-item",
13-
"cards-item-noimage",
1413
"columns",
1514
"embed",
16-
"embed-no-placeholder",
1715
"form",
1816
"fragment",
1917
"hero",
2018
"image",
2119
"journey-map",
2220
"modal",
2321
"related-articles",
24-
"related-articles-links",
2522
"search",
2623
"social-share",
2724
"tabs",
@@ -32,8 +29,7 @@
3229
{
3330
"id": "cards",
3431
"components": [
35-
"cards-item",
36-
"cards-item-noimage"
32+
"cards-item"
3733
]
3834
},
3935
{

component-models.json

Lines changed: 26 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@
176176
"valueType": "string",
177177
"name": "image",
178178
"label": "Image",
179-
"multi": false
179+
"multi": false,
180+
"description": "Optional. Block renders without image when empty."
180181
},
181182
{
182183
"component": "text",
@@ -193,17 +194,6 @@
193194
}
194195
]
195196
},
196-
{
197-
"id": "cards-item-noimage",
198-
"fields": [
199-
{
200-
"component": "richtext",
201-
"name": "text",
202-
"label": "Text",
203-
"valueType": "string"
204-
}
205-
]
206-
},
207197
{
208198
"id": "columns",
209199
"fields": [
@@ -223,13 +213,28 @@
223213
{
224214
"id": "embed",
225215
"fields": [
216+
{
217+
"component": "select",
218+
"name": "classes",
219+
"label": "Variation",
220+
"options": [
221+
{
222+
"name": "With placeholder",
223+
"value": ""
224+
},
225+
{
226+
"name": "No placeholder",
227+
"value": "no-placeholder"
228+
}
229+
]
230+
},
226231
{
227232
"component": "reference",
228233
"valueType": "string",
229234
"name": "image",
230235
"label": "Placeholder Image",
231236
"multi": false,
232-
"description": "Optional thumbnail shown before the video plays"
237+
"description": "Optional thumbnail shown before the video plays. Leave empty when using 'No placeholder' variation."
233238
},
234239
{
235240
"component": "text",
@@ -254,25 +259,6 @@
254259
}
255260
]
256261
},
257-
{
258-
"id": "embed-no-placeholder",
259-
"fields": [
260-
{
261-
"component": "text",
262-
"name": "embedUrl",
263-
"label": "Embed URL",
264-
"valueType": "string",
265-
"required": true,
266-
"description": "URL to embed (YouTube, Vimeo, Twitter, or any embed URL)"
267-
},
268-
{
269-
"component": "text",
270-
"name": "embedUrlText",
271-
"label": "Embed URL Text",
272-
"valueType": "string"
273-
}
274-
]
275-
},
276262
{
277263
"id": "form",
278264
"fields": [
@@ -388,12 +374,19 @@
388374
{
389375
"id": "related-articles",
390376
"fields": [
377+
{
378+
"component": "richtext",
379+
"name": "links",
380+
"label": "Article Links",
381+
"valueType": "string",
382+
"description": "A list of links to specific articles. When present, block uses links mode; otherwise uses keywords."
383+
},
391384
{
392385
"component": "text",
393386
"name": "keywords",
394387
"label": "Keywords",
395388
"valueType": "string",
396-
"description": "Comma-separated keywords to match articles (e.g. fire, tfsa, rrsp). Use 'random' for random articles."
389+
"description": "Comma-separated keywords to match articles (e.g. fire, tfsa, rrsp). Use 'random' for random articles. Used when no links are authored."
397390
},
398391
{
399392
"component": "text",
@@ -404,18 +397,6 @@
404397
}
405398
]
406399
},
407-
{
408-
"id": "related-articles-links",
409-
"fields": [
410-
{
411-
"component": "richtext",
412-
"name": "links",
413-
"label": "Article Links",
414-
"valueType": "string",
415-
"description": "A list of links to specific articles"
416-
}
417-
]
418-
},
419400
{
420401
"id": "search",
421402
"fields": [

ue/models/blocks/cards.json

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,6 @@
2929
]
3030
}
3131
}
32-
},
33-
{
34-
"title": "Card Item (no image)",
35-
"id": "cards-item-noimage",
36-
"model": "cards-item-noimage",
37-
"plugins": {
38-
"da": {
39-
"name": "cards-item-noimage",
40-
"rows": 1,
41-
"columns": 1,
42-
"fields": [
43-
{ "name": "text", "selector": "div:nth-child(1)" }
44-
]
45-
}
46-
}
4732
}
4833
],
4934
"models": [
@@ -69,7 +54,8 @@
6954
"valueType": "string",
7055
"name": "image",
7156
"label": "Image",
72-
"multi": false
57+
"multi": false,
58+
"description": "Optional. Block renders without image when empty."
7359
},
7460
{
7561
"component": "text",
@@ -85,23 +71,12 @@
8571
"valueType": "string"
8672
}
8773
]
88-
},
89-
{
90-
"id": "cards-item-noimage",
91-
"fields": [
92-
{
93-
"component": "richtext",
94-
"name": "text",
95-
"label": "Text",
96-
"valueType": "string"
97-
}
98-
]
9974
}
10075
],
10176
"filters": [
10277
{
10378
"id": "cards",
104-
"components": ["cards-item", "cards-item-noimage"]
79+
"components": ["cards-item"]
10580
}
10681
]
10782
}

ue/models/blocks/embed.json

Lines changed: 11 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"definitions": [
33
{
4-
"title": "Embed (with placeholder)",
4+
"title": "Embed",
55
"id": "embed",
66
"model": "embed",
77
"plugins": {
@@ -17,35 +17,28 @@
1717
]
1818
}
1919
}
20-
},
21-
{
22-
"title": "Embed (no placeholder)",
23-
"id": "embed-no-placeholder",
24-
"model": "embed-no-placeholder",
25-
"plugins": {
26-
"da": {
27-
"name": "embed",
28-
"rows": 1,
29-
"columns": 1,
30-
"fields": [
31-
{ "name": "embedUrl", "selector": "div>div>p>a[href]" },
32-
{ "name": "embedUrlText", "selector": "div>div>p>a" }
33-
]
34-
}
35-
}
3620
}
3721
],
3822
"models": [
3923
{
4024
"id": "embed",
4125
"fields": [
26+
{
27+
"component": "select",
28+
"name": "classes",
29+
"label": "Variation",
30+
"options": [
31+
{ "name": "With placeholder", "value": "" },
32+
{ "name": "No placeholder", "value": "no-placeholder" }
33+
]
34+
},
4235
{
4336
"component": "reference",
4437
"valueType": "string",
4538
"name": "image",
4639
"label": "Placeholder Image",
4740
"multi": false,
48-
"description": "Optional thumbnail shown before the video plays"
41+
"description": "Optional thumbnail shown before the video plays. Leave empty when using 'No placeholder' variation."
4942
},
5043
{
5144
"component": "text",
@@ -69,25 +62,6 @@
6962
"valueType": "string"
7063
}
7164
]
72-
},
73-
{
74-
"id": "embed-no-placeholder",
75-
"fields": [
76-
{
77-
"component": "text",
78-
"name": "embedUrl",
79-
"label": "Embed URL",
80-
"valueType": "string",
81-
"required": true,
82-
"description": "URL to embed (YouTube, Vimeo, Twitter, or any embed URL)"
83-
},
84-
{
85-
"component": "text",
86-
"name": "embedUrlText",
87-
"label": "Embed URL Text",
88-
"valueType": "string"
89-
}
90-
]
9165
}
9266
],
9367
"filters": []

0 commit comments

Comments
 (0)