diff --git a/modules/card/config.yaml b/modules/card/config.yaml index a5a3c7f..e54d8d3 100644 --- a/modules/card/config.yaml +++ b/modules/card/config.yaml @@ -67,6 +67,13 @@ module: primary_button_class: type: 'class' + card_is_link: + type: 'choice' + type_options: + choices: + "card.form.card_is_link.values.no": 'no' + "card.form.card_is_link.values.yes": 'yes' + content_position: type: 'choice' type_options: diff --git a/modules/card/form.html.twig b/modules/card/form.html.twig index 2ad6099..c401631 100644 --- a/modules/card/form.html.twig +++ b/modules/card/form.html.twig @@ -47,10 +47,13 @@
{{ form_widget(form.primary_button_class) }}
+
+ {{ form_widget(form.card_is_link) }} +
{{ form_widget(form.primary_button_text) }}
{{ form_widget(form.primary_button_link) }}
-{{ sfs_cms_admin_module_accordion_block_end() }} \ No newline at end of file +{{ sfs_cms_admin_module_accordion_block_end() }} diff --git a/modules/card/render.html.twig b/modules/card/render.html.twig index 7466d4e..ca87df2 100644 --- a/modules/card/render.html.twig +++ b/modules/card/render.html.twig @@ -20,13 +20,16 @@ {% import '@SfsCms/macros/modules_render.html.twig' as module %} +{% if card_is_link == 'yes' and sfs_cms_link_attr(primary_button_link) != 'href="#"' %} + +{% else %}
+{% endif %} {% if background[app.request.locale].media|default(false) %}
{{ background[app.request.locale].media|sfs_media_render(background[app.request.locale].version) }}
{% endif %} -
{% if media[app.request.locale].media|default(false) %}
{{ media[app.request.locale].media|sfs_media_render(media[app.request.locale].version, {'class':'img-fluid'}) }}
@@ -35,15 +38,22 @@
+{% if card_is_link == 'yes' and sfs_cms_link_attr(primary_button_link) != 'href="#"' %} + +{% else %}
+{% endif %} diff --git a/modules/card/translations/sfs_cms_modules.en.yaml b/modules/card/translations/sfs_cms_modules.en.yaml index a3d6d56..a688a2f 100644 --- a/modules/card/translations/sfs_cms_modules.en.yaml +++ b/modules/card/translations/sfs_cms_modules.en.yaml @@ -42,6 +42,10 @@ card: target.label: "Target" custom_target.label: "Target id" url.label: "Direct URL" + card_is_link.label: "All Card is a link" + card_is_link.values: + yes: "Yes" + no: "No" bg_color.label: "Background color" primary_button_class.label: "Classes" content_position.label: "Content position" diff --git a/modules/card/translations/sfs_cms_modules.es.yaml b/modules/card/translations/sfs_cms_modules.es.yaml index a33fdee..c3ff233 100644 --- a/modules/card/translations/sfs_cms_modules.es.yaml +++ b/modules/card/translations/sfs_cms_modules.es.yaml @@ -42,6 +42,10 @@ card: target.label: "Target" custom_target.label: "Identificador de target" url.label: "URL directa" + card_is_link.label: "Toda la tarjeta es un enlace" + card_is_link.values: + yes: "Sí" + no: "No" bg_color.label: "Color de fondo" primary_button_class.label: "Classes" content_position.label: "Posición del contenido" diff --git a/modules/hero/render.html.twig b/modules/hero/render.html.twig index e6d3fe5..f0ad668 100644 --- a/modules/hero/render.html.twig +++ b/modules/hero/render.html.twig @@ -18,7 +18,9 @@ {% endif %} <{{ title_type|default('h1') }} {{ module.class(title_class, 'sfs-hero__title') }}>{{ title|sfs_cms_trans|raw }}
- {% if description|default(false) %}
{{ description|sfs_cms_trans|raw }}
{% endif %} + {% if description|default(false) and description|sfs_cms_trans is not empty %}
{{ description|sfs_cms_trans|raw }}
{% endif %} + {% if (primary_button_text|default(false) and primary_button_text|sfs_cms_trans is not empty) or + (secondary_button_text|default(false) and secondary_button_text|sfs_cms_trans is not empty) %}
{% if primary_button_text|default(false) and primary_button_text|sfs_cms_trans is not empty %} {{ primary_button_text|sfs_cms_trans|raw }} @@ -28,6 +30,7 @@ {{ secondary_button_text|sfs_cms_trans|raw }} {% endif %}
+ {% endif %}
diff --git a/modules/text_section/render.html.twig b/modules/text_section/render.html.twig index ca8e708..b9824e4 100644 --- a/modules/text_section/render.html.twig +++ b/modules/text_section/render.html.twig @@ -25,7 +25,7 @@
{{ description|raw }}
{% endif %} {% if (primary_button_text|default(false) and primary_button_text|sfs_cms_trans is not empty) %} - {{ primary_button_text|sfs_cms_trans|raw }} + {{ primary_button_text|sfs_cms_trans|raw }} {% endif %} diff --git a/modules/two_columns/render.html.twig b/modules/two_columns/render.html.twig index ee39e85..4435fb8 100644 --- a/modules/two_columns/render.html.twig +++ b/modules/two_columns/render.html.twig @@ -36,10 +36,12 @@
<{{ title_type|default('h2') }} class="sfs-two-columns__title {{ title_class|default('') }}">{{ title|sfs_cms_trans|raw }} + {% if description|default(false) and description|sfs_cms_trans is not empty %}
{{ description|sfs_cms_trans|raw }}
- {% if primary_button_text|sfs_cms_trans|default(false) %} + {% endif %} + {% if primary_button_text|sfs_cms_trans|default(false) and primary_button_text|sfs_cms_trans is not empty %}
{{ primary_button_text|sfs_cms_trans|raw }}