Skip to content

Commit 8b8f1ca

Browse files
committed
Fleshes out basic section with pronto styles
1 parent c5469e9 commit 8b8f1ca

5 files changed

Lines changed: 182 additions & 38 deletions

File tree

acf-json/group_681a543cc36e6.json

Lines changed: 150 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,35 @@
2929
"ajax": 0,
3030
"placeholder": ""
3131
},
32+
{
33+
"key": "field_68e96b4712145",
34+
"label": "Accent",
35+
"name": "accent",
36+
"aria-label": "",
37+
"type": "select",
38+
"instructions": "",
39+
"required": 0,
40+
"conditional_logic": 0,
41+
"wrapper": {
42+
"width": "",
43+
"class": "",
44+
"id": ""
45+
},
46+
"choices": {
47+
"primary": "Primary",
48+
"secondary": "Secondary",
49+
"tertiary": "Tertiary",
50+
"none": "None"
51+
},
52+
"default_value": "none",
53+
"return_format": "value",
54+
"multiple": 0,
55+
"allow_null": 0,
56+
"allow_in_bindings": 0,
57+
"ui": 0,
58+
"ajax": 0,
59+
"placeholder": ""
60+
},
3261
{
3362
"key": "field_681a547283761",
3463
"label": "Primary Content",
@@ -168,11 +197,11 @@
168197
"delay": 0
169198
},
170199
{
171-
"key": "field_681a55cf8376e",
172-
"label": "Link",
173-
"name": "link",
200+
"key": "field_68e96a6e3e373",
201+
"label": "Links",
202+
"name": "links",
174203
"aria-label": "",
175-
"type": "link",
204+
"type": "repeater",
176205
"instructions": "",
177206
"required": 0,
178207
"conditional_logic": [
@@ -189,8 +218,62 @@
189218
"class": "",
190219
"id": ""
191220
},
192-
"return_format": "array",
193-
"allow_in_bindings": 0
221+
"layout": "table",
222+
"pagination": 0,
223+
"min": 0,
224+
"max": 0,
225+
"collapsed": "",
226+
"button_label": "Add Row",
227+
"rows_per_page": 20,
228+
"sub_fields": [
229+
{
230+
"key": "field_681a55cf8376e",
231+
"label": "Link",
232+
"name": "link",
233+
"aria-label": "",
234+
"type": "link",
235+
"instructions": "",
236+
"required": 0,
237+
"conditional_logic": 0,
238+
"wrapper": {
239+
"width": "",
240+
"class": "",
241+
"id": ""
242+
},
243+
"return_format": "array",
244+
"allow_in_bindings": 0,
245+
"parent_repeater": "field_68e96a6e3e373"
246+
},
247+
{
248+
"key": "field_68e96c1826d64",
249+
"label": "Style",
250+
"name": "style",
251+
"aria-label": "",
252+
"type": "select",
253+
"instructions": "",
254+
"required": 0,
255+
"conditional_logic": 0,
256+
"wrapper": {
257+
"width": "",
258+
"class": "",
259+
"id": ""
260+
},
261+
"choices": {
262+
"accent-primary": "Primary",
263+
"accent-secondary": "Secondary",
264+
"outline": "Outline"
265+
},
266+
"default_value": "accent-primary",
267+
"return_format": "value",
268+
"multiple": 0,
269+
"allow_null": 0,
270+
"allow_in_bindings": 0,
271+
"ui": 0,
272+
"ajax": 0,
273+
"placeholder": "",
274+
"parent_repeater": "field_68e96a6e3e373"
275+
}
276+
]
194277
},
195278
{
196279
"key": "field_681a54f783765",
@@ -450,11 +533,11 @@
450533
"delay": 0
451534
},
452535
{
453-
"key": "field_681a55aa8376d",
454-
"label": "Link",
455-
"name": "link",
536+
"key": "field_68e96a9008838",
537+
"label": "Links",
538+
"name": "links",
456539
"aria-label": "",
457-
"type": "link",
540+
"type": "repeater",
458541
"instructions": "",
459542
"required": 0,
460543
"conditional_logic": [
@@ -471,8 +554,62 @@
471554
"class": "",
472555
"id": ""
473556
},
474-
"return_format": "array",
475-
"allow_in_bindings": 0
557+
"layout": "table",
558+
"pagination": 0,
559+
"min": 0,
560+
"max": 0,
561+
"collapsed": "",
562+
"button_label": "Add Row",
563+
"rows_per_page": 20,
564+
"sub_fields": [
565+
{
566+
"key": "field_681a55aa8376d",
567+
"label": "Link",
568+
"name": "link",
569+
"aria-label": "",
570+
"type": "link",
571+
"instructions": "",
572+
"required": 0,
573+
"conditional_logic": 0,
574+
"wrapper": {
575+
"width": "",
576+
"class": "",
577+
"id": ""
578+
},
579+
"return_format": "array",
580+
"allow_in_bindings": 0,
581+
"parent_repeater": "field_68e96a9008838"
582+
},
583+
{
584+
"key": "field_68e96c7426d65",
585+
"label": "Style",
586+
"name": "style",
587+
"aria-label": "",
588+
"type": "select",
589+
"instructions": "",
590+
"required": 0,
591+
"conditional_logic": 0,
592+
"wrapper": {
593+
"width": "",
594+
"class": "",
595+
"id": ""
596+
},
597+
"choices": {
598+
"accent-primary": "Primary",
599+
"accent-secondary": "Secondary",
600+
"outline": "Outline"
601+
},
602+
"default_value": "accent-primary",
603+
"return_format": "value",
604+
"multiple": 0,
605+
"allow_null": 0,
606+
"allow_in_bindings": 0,
607+
"ui": 0,
608+
"ajax": 0,
609+
"placeholder": "",
610+
"parent_repeater": "field_68e96a9008838"
611+
}
612+
]
476613
},
477614
{
478615
"key": "field_681a55808376c",
@@ -640,5 +777,5 @@
640777
"active": true,
641778
"description": "",
642779
"show_in_rest": 0,
643-
"modified": 1746630658
780+
"modified": 1760128131
644781
}

templates/blocks/basic-section.twig

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,20 @@
22
{% set layout = block.layout %}
33
{% set sections = layout == 'wide' ? [block.primary_content] : [block.primary_content, block.secondary_content] %}
44

5-
<div class="o-basic-section">
6-
<div class="o-basic-section__content o-basic-section__content--{{ layout }}">
5+
<div class="section container basicSection accent-{{ block.accent }}">
6+
{% if block.heading or block.sub_heading %}
7+
<header class="section__header">
8+
{% if block.sub_heading %}
9+
<h2 class="h6 accent-primary">{{ block.sub_heading }}</h2>
10+
{% endif %}
11+
{% if block.section__heading %}
12+
<h3>{{ block.section__heading }}</h3>
13+
{% endif %}
14+
</header>
15+
{% endif %}
16+
<div class="basicSection__content -center">
717
{% for section in sections %}
8-
<div class="o-basic-section__section o-basic-section__section--{{ section.width }}">
9-
{% if section.content_type == 'text' %}
10-
<div class="o-basic-section__text">
11-
<div class="o-basic-section__heading">
12-
{{ section.heading }}
13-
</div>
14-
<div class="o-basic-section__content">
15-
{{ section.content }}
16-
</div>
17-
{% if section.link %}
18-
<a href="{{ section.link.url }}" class="a-button">{{ section.link.title }}</a>
19-
{% endif %}
20-
</div>
21-
{% elseif section.content_type == 'image' %}
22-
<div class="o-basic-section__image">
23-
<img src="{{ section.image.url }}" alt="{{ section.image.alt }}">
24-
</div>
25-
{% elseif section.content_type == 'card' %}
26-
<div class="o-basic-section__card">
27-
{% include "partials/card.twig" with {'card': section.card} %}
28-
</div>
29-
{% endif %}
30-
</div>
18+
{% include "partials/basic-section/content-"~section.content_type~".twig" with {'section': section} %}
3119
{% endfor %}
3220
</div>
3321
</div>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div class="basicSection__card">
2+
{% include "partials/card.twig" with {'card': section.card} %}
3+
</div>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<div class="basicSection__image">
2+
<div class="placeholder" style="aspect-ratio: 634 / 368">
3+
<img src="{{ section.image.url }}" alt="{{ section.image.alt }}">
4+
</div>
5+
</div>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<div class="basicSection__text">
2+
<h3>{{ section.heading }}</h3>
3+
<p>{{ section.content }}</p>
4+
{% if section.links %}
5+
<div class="actions">
6+
{% for cta in section.links %}
7+
<a class="button -{{ cta.style }}" href="{{ cta.link.url }}">{{ cta.link.title }}</a>
8+
{% endfor %}
9+
</div>
10+
{% endif %}
11+
</div>

0 commit comments

Comments
 (0)