From 0894bbf13f59f2bc652b19d3cf239adfa6473ab2 Mon Sep 17 00:00:00 2001 From: "Javi H. Gil" Date: Tue, 29 Oct 2024 22:21:48 +0100 Subject: [PATCH 1/3] Rename ci workflow --- .github/workflows/{php.yml => ci.yml} | 0 README.md | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{php.yml => ci.yml} (100%) diff --git a/.github/workflows/php.yml b/.github/workflows/ci.yml similarity index 100% rename from .github/workflows/php.yml rename to .github/workflows/ci.yml diff --git a/README.md b/README.md index aa76b57..506b75e 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ![License](https://img.shields.io/packagist/l/softspring/cms-module-collection?style=flat-square) ![PHP Version](https://img.shields.io/packagist/dependency-v/softspring/cms-module-collection/php?style=flat-square) ![Downloads](https://img.shields.io/packagist/dt/softspring/cms-module-collection?style=flat-square) -[![CI](https://img.shields.io/github/actions/workflow/status/softspring/cms-module-collection/php.yml?branch=5.3&style=flat-square&label=CI)](https://github.com/softspring/cms-module-collection/actions/workflows/php.yml) +[![CI](https://img.shields.io/github/actions/workflow/status/softspring/cms-module-collection/ci.yml?branch=5.3&style=flat-square&label=CI)](https://github.com/softspring/cms-module-collection/actions/workflows/ci.yml) ## Installation From f45e521e7442006a21ae5ac34d9624ededae3789 Mon Sep 17 00:00:00 2001 From: Eva Date: Thu, 21 Nov 2024 14:40:16 +0100 Subject: [PATCH 2/3] Hotfix/no render empty elements (#58) * Fix render empty fields * Revert workflow changes * Revert workflow changes * Revert workflow changes --- modules/card/render.html.twig | 9 ++++----- modules/hero/render.html.twig | 5 ++++- modules/two_columns/render.html.twig | 4 +++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/modules/card/render.html.twig b/modules/card/render.html.twig index 7466d4e..fa9917d 100644 --- a/modules/card/render.html.twig +++ b/modules/card/render.html.twig @@ -35,15 +35,14 @@
{{ module.start_tag_type(title_type, [module.class(title_class, titleClass|default('sfs-card__title'))]) }}{{ title|sfs_cms_trans|raw }}{{ module.end_tag_type(title_type) }} - {% if description|default(false) %} + {% 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 %}
- {% if primary_button_text|sfs_cms_trans %} - {{ primary_button_text|sfs_cms_trans|raw }} - {% endif %} + {{ primary_button_text|sfs_cms_trans|raw }}
+ {% endif %}
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/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 %} From aa136530e5e96cf23195117b513c68d2bad8be44 Mon Sep 17 00:00:00 2001 From: ebpe Date: Wed, 27 Nov 2024 12:31:14 +0100 Subject: [PATCH 3/3] Add card_is_link option in card module --- modules/card/config.yaml | 7 +++++++ modules/card/form.html.twig | 5 ++++- modules/card/render.html.twig | 19 +++++++++++++++---- .../card/translations/sfs_cms_modules.en.yaml | 4 ++++ .../card/translations/sfs_cms_modules.es.yaml | 4 ++++ modules/text_section/render.html.twig | 2 +- 6 files changed, 35 insertions(+), 6 deletions(-) diff --git a/modules/card/config.yaml b/modules/card/config.yaml index 6586758..cff1024 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 fa9917d..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 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/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 %}