From 253625b6bcacf57ebbced91b7990b97815e89d2c Mon Sep 17 00:00:00 2001 From: Antonino Del Fiume Date: Mon, 20 Jan 2025 15:53:20 +0100 Subject: [PATCH] Add info text and tooltip above the field --- .../form/checkbox/prototype/template.twig | 51 ++++++++++--------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/content-elements/form/checkbox/prototype/template.twig b/content-elements/form/checkbox/prototype/template.twig index a19f0f2..7e609ba 100644 --- a/content-elements/form/checkbox/prototype/template.twig +++ b/content-elements/form/checkbox/prototype/template.twig @@ -1,26 +1,31 @@ -{% macro render(elementId = null, elementPartId = null, formTextPartId = null, errorRequiredPartId = null, labelText = null, infoText = null, errorRequiredText = null) %}{% apply spaceless %} - {% deprecated 'The usage of "element.render(...)" is deprecated, use "include ... with {...}" instead. For detailed information, visit: https://github.com/bsi-software/bsi-cx-design-master-template-web/blob/main/MIGRATION_GUIDE.md"' %} - {% include './template.twig' %} -{% endapply %}{% endmacro %} +{% macro render(elementId = null, elementPartId = null, formTextPartId = null, errorRequiredPartId = null, labelText = null, infoText = null, errorRequiredText = null) %} + {% apply spaceless %} + {% deprecated 'The usage of "element.render(...)" is deprecated, use "include ... with {...}" instead. For detailed information, visit: https://github.com/bsi-software/bsi-cx-design-master-template-web/blob/main/MIGRATION_GUIDE.md"' %} + {% include './template.twig' %} + {% endapply %} +{% endmacro %} {% apply spaceless %} - {% set checkboxElementId = elementId ?: 'checkbox-24CNSe' %} - {% set checkboxElementPartId = elementPartId ?: 'checkbox-part-Nls88s' %} - {% set checkboxFormTextPartId = formTextPartId ?: 'checkbox-part-text-6ycJm4' %} - {% set checkboxErrorRequiredPartId = errorRequiredPartId ?: 'checkbox-part-error-required-iYG8Ss' %} - {% set checkboxLabelText = (labelText ?: properties.checkboxLabelText) ?: bsi_cx_lorem(3) %} - {% set checkboxInfoText = (infoText ?: properties.checkboxInfoText) ?: "" %} - {% set checkboxErrorRequiredText = (errorRequiredText ?: properties.errorRequiredText) ?: 'Bitte füllen Sie dieses Feld aus.' %} {# TODO: make translatable #} +{% set checkboxElementId = elementId ?: 'checkbox-24CNSe' %} +{% set checkboxElementPartId = elementPartId ?: 'checkbox-part-Nls88s' %} +{% set checkboxFormTextPartId = formTextPartId ?: 'checkbox-part-text-6ycJm4' %} +{% set checkboxErrorRequiredPartId = errorRequiredPartId ?: 'checkbox-part-error-required-iYG8Ss' %} +{% set checkboxLabelText = (labelText ?: properties.checkboxLabelText) ?: bsi_cx_lorem(3) %} +{% set checkboxInfoText = (infoText ?: properties.checkboxInfoText) ?: "" %} +{% set checkboxErrorRequiredText = (errorRequiredText ?: properties.errorRequiredText) ?: 'Bitte füllen Sie dieses Feld aus.' %} +{# TODO: make translatable #} -
-
- -
- - -
-
{{ checkboxInfoText }}
-
{{ checkboxErrorRequiredText }}
-
-
-{% endapply %} \ No newline at end of file +
+
+
+
{{ checkboxInfoText }}
+ +
+ + +
+ {{ checkboxErrorRequiredText }} +
+
+
+{% endapply %}