Cleaned up Sarahs code - Privacy Checkbox

This commit is contained in:
Paul580710 committed 2026-03-26 16:17:13 +01:00
1 parent d09d7b06cb
commit c1d25395f1
1 file changed
+71 -20
+71 -20
View File
@@ -112,7 +112,7 @@
{% if block.settings.required %}required{% endif %}/>
{% endif %}
{% endif %}
{% when 'calendar_input' %}
{% if block.settings.title != blank %}
{%- assign title_handle = block.settings.title | handle -%}
@@ -148,29 +148,55 @@
{% when 'text' %}
<div class="rte">{{ block.settings.text }}</div>
{% when 'privacy_input' %}
<!-- PRIVACY CHECKBOX HIER -->
<div class="field field--checkbox lightly-spaced-row">
<label class="field__label" for="privacy">
<input
class="field__input"
type="checkbox"
id="privacy"
name="contact[privacy]"
required
value="yes"
>
* I agree to the <a href="/pages/privacy-policy" target="_blank">Privacy Policy</a>
</label>
</div>
<div class="lightly-spaced-row">
<button type="submit">{{ 'contact.form.send' | t }}</button>
</div>
{% when 'privacy_input' %}
{% if block.settings.title != blank %}
<!-- PRIVACY CHECKBOX HIER -->
<div class="field field--checkbox lightly-spaced-row">
{%- assign title_handle = block.settings.title | handle -%}
<label for="contact_{{ title_handle }}">{{ block.settings.title | escape }}</label>
<input
class="field__input"
type="checkbox"
id="privacy"
name="contact[privacy]"
required
value="yes"
>
<!--{{ block.settings.textin | escape }}-->
* I agree to the <a href="/pages/privacy-policy" target="_blank">Privacy Policy</a>
</label>
</div>
{% endif %}
<div class="lightly-spaced-row">
<button type="submit">{{ 'contact.form.send' | t }}</button>
</div>
{% endcase %}
</div>
{% endfor %}
</div>
<!-- PRIVACY CHECKBOX HIER -->
<div class="field field--checkbox lightly-spaced-row">
<label class="field__label" for="privacy">
<input
class="field__input"
type="checkbox"
id="privacy"
name="contact[privacy]"
required
value="yes"
>
* I agree to the <a href="/pages/privacy-policy" target="_blank">Privacy Policy</a>
</label>
</div>
<div class="lightly-spaced-row">
<button type="submit">{{ 'contact.form.send' | t }}</button>
</div>
{% endif %}
{% endform %}
</div>
@@ -213,7 +239,7 @@
onClose: function(selectedDates, dateStr, instance) {
$(instance.altInput).prop('readonly', false);
$(instance.altInput).blur();
}
}
});
});
</script>
@@ -335,6 +361,31 @@
}
]
},
{
"type": "privacy_input",
"name": "Privacy Checkbox",
"limit": 1,
"settings": [
{
"type": "text",
"id": "title",
"label": "Label",
"default": "Privacy"
},
{
"type": "text",
"id": "textin",
"label": "Label",
"default": "Privacy"
},
{
"type": "checkbox",
"id": "required",
"label": "Required",
"default": true
},
]
},
{
"type": "custom_input",
"name": "Custom input",