From 0dc16dc8ed8321a78af670b0e4632a1ea2815c84 Mon Sep 17 00:00:00 2001 From: Gabi Udrescu Date: Thu, 22 Aug 2024 19:14:52 +0000 Subject: [PATCH 1/4] Add ability to control the target for a button --- src/Form/Type/UiElement/ButtonLinkType.php | 7 +++++++ src/Resources/translations/messages.en.yml | 1 + src/Resources/translations/messages.es.yml | 1 + src/Resources/translations/messages.fr.yml | 1 + src/Resources/translations/messages.hr.yml | 1 + src/Resources/translations/messages.nl.yml | 1 + src/Resources/translations/messages.pl.yaml | 1 + src/Resources/views/Admin/UiElement/button.html.twig | 4 +++- 8 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Form/Type/UiElement/ButtonLinkType.php b/src/Form/Type/UiElement/ButtonLinkType.php index e9bac5fe..7c24be33 100644 --- a/src/Form/Type/UiElement/ButtonLinkType.php +++ b/src/Form/Type/UiElement/ButtonLinkType.php @@ -16,6 +16,7 @@ use MonsieurBiz\SyliusRichEditorPlugin\Form\Type\AlignmentType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\TextType as FormTextType; +use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Validator\Constraints as Assert; @@ -67,6 +68,12 @@ public function buildForm(FormBuilderInterface $builder, array $options): void 'label' => 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.button.field.link', 'constraints' => $constraintsLink, ]) + ->add('target', ChoiceType::class, [ + 'choices' => [ + 'Open in the same frame as it was clicked (this is default)' => '_self', + 'Open in a new window or tab' => '_blank', + ], + ]) ->add('align', AlignmentType::class) ; } diff --git a/src/Resources/translations/messages.en.yml b/src/Resources/translations/messages.en.yml index eca41092..679e3814 100644 --- a/src/Resources/translations/messages.en.yml +++ b/src/Resources/translations/messages.en.yml @@ -80,6 +80,7 @@ monsieurbiz_richeditor_plugin: field: label: 'Label' link: 'Link' + target: 'Target' monsieurbiz.youtube: title: 'Youtube Element' short_description: 'A Youtube element.' diff --git a/src/Resources/translations/messages.es.yml b/src/Resources/translations/messages.es.yml index d23a3c1b..8564b375 100644 --- a/src/Resources/translations/messages.es.yml +++ b/src/Resources/translations/messages.es.yml @@ -80,6 +80,7 @@ monsieurbiz_richeditor_plugin: field: label: 'Etiqueta' link: 'Enlace' + target: 'Destino' monsieurbiz.youtube: title: 'Elemento de Youtube' short_description: 'Un elemento de Youtube.' diff --git a/src/Resources/translations/messages.fr.yml b/src/Resources/translations/messages.fr.yml index b24ae869..dafe99d7 100644 --- a/src/Resources/translations/messages.fr.yml +++ b/src/Resources/translations/messages.fr.yml @@ -80,6 +80,7 @@ monsieurbiz_richeditor_plugin: field: label: 'Libellé' link: 'Lien' + target: 'Cible' monsieurbiz.youtube: title: 'Lame Youtube' short_description: 'Une vidéo youtube.' diff --git a/src/Resources/translations/messages.hr.yml b/src/Resources/translations/messages.hr.yml index 86f01ca5..21e7ae0b 100644 --- a/src/Resources/translations/messages.hr.yml +++ b/src/Resources/translations/messages.hr.yml @@ -80,6 +80,7 @@ monsieurbiz_richeditor_plugin: field: label: 'Natpis na gumbu' link: 'URL linka' + target: 'Ciljni' monsieurbiz.youtube: title: 'YouTube video' short_description: 'Element s YouTube videom.' diff --git a/src/Resources/translations/messages.nl.yml b/src/Resources/translations/messages.nl.yml index 339f8d1e..f5643f63 100644 --- a/src/Resources/translations/messages.nl.yml +++ b/src/Resources/translations/messages.nl.yml @@ -62,6 +62,7 @@ monsieurbiz_richeditor_plugin: field: label: 'Label' link: 'Link' + target: 'Doelkenmerk' monsieurbiz.youtube: title: 'YouTube-video' short_description: 'Een YouTube-element.' diff --git a/src/Resources/translations/messages.pl.yaml b/src/Resources/translations/messages.pl.yaml index e4d38a0c..8e1a9916 100644 --- a/src/Resources/translations/messages.pl.yaml +++ b/src/Resources/translations/messages.pl.yaml @@ -80,6 +80,7 @@ monsieurbiz_richeditor_plugin: field: label: 'Etykieta' link: 'Link' + target: 'Docelowy' monsieurbiz.youtube: title: 'Element YouTube' short_description: 'Element YouTube.' diff --git a/src/Resources/views/Admin/UiElement/button.html.twig b/src/Resources/views/Admin/UiElement/button.html.twig index 97d2fe1d..e2f960c5 100644 --- a/src/Resources/views/Admin/UiElement/button.html.twig +++ b/src/Resources/views/Admin/UiElement/button.html.twig @@ -4,9 +4,11 @@ element fields : label link + target align #} {% set align = element.align is defined and element.align is not empty ? element.align : 'center' %} +{% set target = element.target is defined and element.target is not empty ? element.target : '_self' %}

- {{ element.label }} + {{ element.label }}

From d3aa044cdd7062558564d41e57021b9e32368094 Mon Sep 17 00:00:00 2001 From: Gabi Udrescu Date: Thu, 22 Aug 2024 19:46:14 +0000 Subject: [PATCH 2/4] fix feedback --- src/Form/Type/UiElement/ButtonLinkType.php | 4 ++-- src/Resources/translations/messages.en.yml | 3 +++ src/Resources/views/Admin/UiElement/button.html.twig | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Form/Type/UiElement/ButtonLinkType.php b/src/Form/Type/UiElement/ButtonLinkType.php index 7c24be33..a3cd2137 100644 --- a/src/Form/Type/UiElement/ButtonLinkType.php +++ b/src/Form/Type/UiElement/ButtonLinkType.php @@ -70,8 +70,8 @@ public function buildForm(FormBuilderInterface $builder, array $options): void ]) ->add('target', ChoiceType::class, [ 'choices' => [ - 'Open in the same frame as it was clicked (this is default)' => '_self', - 'Open in a new window or tab' => '_blank', + 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.button.field.target_option.self' => '_self', + 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.button.field.target_option.blank' => '_blank', ], ]) ->add('align', AlignmentType::class) diff --git a/src/Resources/translations/messages.en.yml b/src/Resources/translations/messages.en.yml index 679e3814..72bc5223 100644 --- a/src/Resources/translations/messages.en.yml +++ b/src/Resources/translations/messages.en.yml @@ -81,6 +81,9 @@ monsieurbiz_richeditor_plugin: label: 'Label' link: 'Link' target: 'Target' + target_option: + self: 'Open in the same frame as it was clicked (this is default)' + blank: 'Open in a new window or tab' monsieurbiz.youtube: title: 'Youtube Element' short_description: 'A Youtube element.' diff --git a/src/Resources/views/Admin/UiElement/button.html.twig b/src/Resources/views/Admin/UiElement/button.html.twig index e2f960c5..5b5cce30 100644 --- a/src/Resources/views/Admin/UiElement/button.html.twig +++ b/src/Resources/views/Admin/UiElement/button.html.twig @@ -9,6 +9,8 @@ #} {% set align = element.align is defined and element.align is not empty ? element.align : 'center' %} {% set target = element.target is defined and element.target is not empty ? element.target : '_self' %} +{% set rel = element.target is defined and element.target == '_blank' ? 'rel="noopener noreferrer"' : '' } +

- {{ element.label }} + {{ element.label }}

From 391539149192e3c462da8cc8669cdce8804c9811 Mon Sep 17 00:00:00 2001 From: Gabi Udrescu Date: Thu, 22 Aug 2024 19:48:58 +0000 Subject: [PATCH 3/4] fix typo --- src/Resources/views/Admin/UiElement/button.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Resources/views/Admin/UiElement/button.html.twig b/src/Resources/views/Admin/UiElement/button.html.twig index 5b5cce30..a6efec79 100644 --- a/src/Resources/views/Admin/UiElement/button.html.twig +++ b/src/Resources/views/Admin/UiElement/button.html.twig @@ -9,7 +9,7 @@ #} {% set align = element.align is defined and element.align is not empty ? element.align : 'center' %} {% set target = element.target is defined and element.target is not empty ? element.target : '_self' %} -{% set rel = element.target is defined and element.target == '_blank' ? 'rel="noopener noreferrer"' : '' } +{% set rel = element.target is defined and element.target == '_blank' ? 'rel="noopener noreferrer"' : '' %}

{{ element.label }} From 570c8fa73a006042e10dd3b2976cd08c74b8ffc2 Mon Sep 17 00:00:00 2001 From: Maxime Huran Date: Mon, 26 Aug 2024 17:28:09 +0200 Subject: [PATCH 4/4] Change links to UrlType with correct constraints and manage link type --- src/Form/Type/LinkTypeType.php | 37 +++++++++++++++++++ src/Form/Type/UiElement/ButtonLinkType.php | 21 ++++++----- src/Form/Type/UiElement/ImageType.php | 9 ++++- src/Resources/translations/messages.en.yml | 8 ++-- src/Resources/translations/messages.es.yml | 6 ++- src/Resources/translations/messages.fr.yml | 5 ++- src/Resources/translations/messages.hr.yml | 5 ++- src/Resources/translations/messages.nl.yml | 5 ++- src/Resources/translations/messages.pl.yaml | 5 ++- .../views/Admin/UiElement/button.html.twig | 9 +++-- .../views/Admin/UiElement/image.html.twig | 4 +- .../views/Shop/UiElement/button.html.twig | 4 +- .../views/Shop/UiElement/image.html.twig | 4 +- 13 files changed, 95 insertions(+), 27 deletions(-) create mode 100644 src/Form/Type/LinkTypeType.php diff --git a/src/Form/Type/LinkTypeType.php b/src/Form/Type/LinkTypeType.php new file mode 100644 index 00000000..a88ced2e --- /dev/null +++ b/src/Form/Type/LinkTypeType.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace MonsieurBiz\SyliusRichEditorPlugin\Form\Type; + +use Symfony\Component\Form\Extension\Core\Type\ChoiceType; +use Symfony\Component\OptionsResolver\OptionsResolver; + +class LinkTypeType extends ChoiceType +{ + public const TYPE_INTERNAL = 'internal'; + + public const TYPE_EXTERNAL = 'external'; + + public function configureOptions(OptionsResolver $resolver): void + { + parent::configureOptions($resolver); + $resolver->setDefaults([ + 'label' => 'monsieurbiz_richeditor_plugin.common.link_type', + 'choices' => [ + 'monsieurbiz_richeditor_plugin.common.internal_link' => self::TYPE_INTERNAL, + 'monsieurbiz_richeditor_plugin.common.external_link' => self::TYPE_EXTERNAL, + ], + 'multiple' => false, + ]); + } +} diff --git a/src/Form/Type/UiElement/ButtonLinkType.php b/src/Form/Type/UiElement/ButtonLinkType.php index a3cd2137..ceb945ef 100644 --- a/src/Form/Type/UiElement/ButtonLinkType.php +++ b/src/Form/Type/UiElement/ButtonLinkType.php @@ -14,9 +14,10 @@ namespace MonsieurBiz\SyliusRichEditorPlugin\Form\Type\UiElement; use MonsieurBiz\SyliusRichEditorPlugin\Form\Type\AlignmentType; +use MonsieurBiz\SyliusRichEditorPlugin\Form\Type\LinkTypeType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\TextType as FormTextType; -use Symfony\Component\Form\Extension\Core\Type\ChoiceType; +use Symfony\Component\Form\Extension\Core\Type\UrlType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Validator\Constraints as Assert; @@ -32,26 +33,30 @@ public function buildForm(FormBuilderInterface $builder, array $options): void $constraintsLabel = [ new Assert\NotBlank([]), ]; + $constraintsLinkType = [ + new Assert\NotBlank([]), + ]; $constraintsLink = [ new Assert\AtLeastOneOf([ 'includeInternalMessages' => false, 'message' => 'monsieurbiz_richeditor_plugin.not_valid_url', 'constraints' => [ new Assert\Url(['protocols' => ['http', 'https'], 'relativeProtocol' => true]), - new Assert\Regex(['pattern' => '`^(#|/[^/])`']), + new Assert\Regex(['pattern' => '`^(#|/.*)$`']), ], ]), new Assert\NotBlank([]), ]; } else { $constraintsLabel = []; + $constraintsLinkType = []; $constraintsLink = [ new Assert\AtLeastOneOf([ 'includeInternalMessages' => false, 'message' => 'monsieurbiz_richeditor_plugin.not_valid_url', 'constraints' => [ new Assert\Url(['protocols' => ['http', 'https'], 'relativeProtocol' => true]), - new Assert\Regex(['pattern' => '`^(#|/[^/])`']), + new Assert\Regex(['pattern' => '`^(#|/.*)$`']), ], ]), ]; @@ -63,16 +68,14 @@ public function buildForm(FormBuilderInterface $builder, array $options): void 'label' => 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.button.field.label', 'constraints' => $constraintsLabel, ]) - ->add('link', FormTextType::class, [ + ->add('link', UrlType::class, [ 'required' => $required, 'label' => 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.button.field.link', 'constraints' => $constraintsLink, ]) - ->add('target', ChoiceType::class, [ - 'choices' => [ - 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.button.field.target_option.self' => '_self', - 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.button.field.target_option.blank' => '_blank', - ], + ->add('link_type', LinkTypeType::class, [ + 'required' => $required, + 'constraints' => $constraintsLinkType, ]) ->add('align', AlignmentType::class) ; diff --git a/src/Form/Type/UiElement/ImageType.php b/src/Form/Type/UiElement/ImageType.php index c4465d36..c6d7b52b 100644 --- a/src/Form/Type/UiElement/ImageType.php +++ b/src/Form/Type/UiElement/ImageType.php @@ -16,10 +16,12 @@ use MonsieurBiz\SyliusMediaManagerPlugin\Form\Type\ImageType as MediaManagerImageType; use MonsieurBiz\SyliusRichEditorPlugin\Form\Constraints\RichEditorConstraints; use MonsieurBiz\SyliusRichEditorPlugin\Form\Type\AlignmentType; +use MonsieurBiz\SyliusRichEditorPlugin\Form\Type\LinkTypeType; use MonsieurBiz\SyliusRichEditorPlugin\MonsieurBizSyliusRichEditorPlugin; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\FileType; use Symfony\Component\Form\Extension\Core\Type\TextType as FormTextType; +use Symfony\Component\Form\Extension\Core\Type\UrlType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormEvent; use Symfony\Component\Form\FormEvents; @@ -56,7 +58,7 @@ public function addFields(FormBuilderInterface $builder, array $options): void 'required' => false, 'label' => 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.image.field.title', ]) - ->add('link', FormTextType::class, [ + ->add('link', UrlType::class, [ 'required' => false, 'label' => 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.image.field.link', 'constraints' => [ @@ -65,11 +67,14 @@ public function addFields(FormBuilderInterface $builder, array $options): void 'message' => 'monsieurbiz_richeditor_plugin.not_valid_url', 'constraints' => [ new Assert\Url(['protocols' => ['http', 'https'], 'relativeProtocol' => true]), - new Assert\Regex(['pattern' => '`^(#|/[^/])`']), + new Assert\Regex(['pattern' => '`^(#|/.*)$`']), ], ]), ], ]) + ->add('link_type', LinkTypeType::class, [ + 'required' => false, + ]) ->add('align', AlignmentType::class) ; } diff --git a/src/Resources/translations/messages.en.yml b/src/Resources/translations/messages.en.yml index 72bc5223..bd6a1704 100644 --- a/src/Resources/translations/messages.en.yml +++ b/src/Resources/translations/messages.en.yml @@ -80,10 +80,6 @@ monsieurbiz_richeditor_plugin: field: label: 'Label' link: 'Link' - target: 'Target' - target_option: - self: 'Open in the same frame as it was clicked (this is default)' - blank: 'Open in a new window or tab' monsieurbiz.youtube: title: 'Youtube Element' short_description: 'A Youtube element.' @@ -146,3 +142,7 @@ monsieurbiz_richeditor_plugin: unallowed_uielement: 'Element not allowed here' ui: disabled: 'Disabled' + common: + link_type: 'Link type' + internal_link: 'Internal link' + external_link: 'External link' diff --git a/src/Resources/translations/messages.es.yml b/src/Resources/translations/messages.es.yml index 8564b375..7e77b440 100644 --- a/src/Resources/translations/messages.es.yml +++ b/src/Resources/translations/messages.es.yml @@ -80,7 +80,6 @@ monsieurbiz_richeditor_plugin: field: label: 'Etiqueta' link: 'Enlace' - target: 'Destino' monsieurbiz.youtube: title: 'Elemento de Youtube' short_description: 'Un elemento de Youtube.' @@ -140,3 +139,8 @@ monsieurbiz_richeditor_plugin: unallowed_uielement: 'Elemento no permitido aquí' ui: disabled: 'Desactivado' + common: + link_type: 'Tipo de enlace' + internal_link: 'Enlace interno' + external_link: 'Enlace externo' + diff --git a/src/Resources/translations/messages.fr.yml b/src/Resources/translations/messages.fr.yml index dafe99d7..2e6dad06 100644 --- a/src/Resources/translations/messages.fr.yml +++ b/src/Resources/translations/messages.fr.yml @@ -80,7 +80,6 @@ monsieurbiz_richeditor_plugin: field: label: 'Libellé' link: 'Lien' - target: 'Cible' monsieurbiz.youtube: title: 'Lame Youtube' short_description: 'Une vidéo youtube.' @@ -143,3 +142,7 @@ monsieurbiz_richeditor_plugin: unallowed_uielement: 'Élément non autorisé ici' ui: disabled: 'Désactivé' + common: + link_type: 'Type de lien' + internal_link: 'Lien interne' + external_link: 'Lien externe' diff --git a/src/Resources/translations/messages.hr.yml b/src/Resources/translations/messages.hr.yml index 21e7ae0b..02eff4a2 100644 --- a/src/Resources/translations/messages.hr.yml +++ b/src/Resources/translations/messages.hr.yml @@ -80,7 +80,6 @@ monsieurbiz_richeditor_plugin: field: label: 'Natpis na gumbu' link: 'URL linka' - target: 'Ciljni' monsieurbiz.youtube: title: 'YouTube video' short_description: 'Element s YouTube videom.' @@ -131,3 +130,7 @@ monsieurbiz_richeditor_plugin: cannot_find_type: 'Vrsta dijela elemenata nije podržana.' cannot_upload_image: 'Postoji tehnički problem. Molimo kontaktirajte svog administratora.' ajax_error: 'Technikai probléma van. Kérjük, lépjen kapcsolatba rendszergazdájával.' + common: + link_type: 'Tip linka' + internal_link: 'Unutarnji link' + external_link: 'Vanjski link' diff --git a/src/Resources/translations/messages.nl.yml b/src/Resources/translations/messages.nl.yml index f5643f63..d23031f4 100644 --- a/src/Resources/translations/messages.nl.yml +++ b/src/Resources/translations/messages.nl.yml @@ -62,7 +62,6 @@ monsieurbiz_richeditor_plugin: field: label: 'Label' link: 'Link' - target: 'Doelkenmerk' monsieurbiz.youtube: title: 'YouTube-video' short_description: 'Een YouTube-element.' @@ -105,3 +104,7 @@ monsieurbiz_richeditor_plugin: cannot_find_type: 'Kan type niet vinden voor sommige UI-elementen' cannot_upload_image: 'Kan de afbeelding niet uploaden. Het bestand is mogelijk te groot of heeft een onjuist formaat.' ajax_error: 'Er is een technisch probleem. Neem contact op met uw beheerder.' + common: + link_type: 'Type link' + internal_link: 'Interne link' + external_link: 'Externe link' diff --git a/src/Resources/translations/messages.pl.yaml b/src/Resources/translations/messages.pl.yaml index 8e1a9916..0d7c567f 100644 --- a/src/Resources/translations/messages.pl.yaml +++ b/src/Resources/translations/messages.pl.yaml @@ -80,7 +80,6 @@ monsieurbiz_richeditor_plugin: field: label: 'Etykieta' link: 'Link' - target: 'Docelowy' monsieurbiz.youtube: title: 'Element YouTube' short_description: 'Element YouTube.' @@ -143,3 +142,7 @@ monsieurbiz_richeditor_plugin: unallowed_uielement: 'Element niedozwolony tutaj' ui: disabled: 'Wyłączone' + common: + link_type: 'Typ linku' + internal_link: 'Link wewnętrzny' + external_link: 'Link zewnętrzny' diff --git a/src/Resources/views/Admin/UiElement/button.html.twig b/src/Resources/views/Admin/UiElement/button.html.twig index a6efec79..5f7057da 100644 --- a/src/Resources/views/Admin/UiElement/button.html.twig +++ b/src/Resources/views/Admin/UiElement/button.html.twig @@ -4,13 +4,14 @@ element fields : label link - target + link_type align #} {% set align = element.align is defined and element.align is not empty ? element.align : 'center' %} -{% set target = element.target is defined and element.target is not empty ? element.target : '_self' %} -{% set rel = element.target is defined and element.target == '_blank' ? 'rel="noopener noreferrer"' : '' %} +{% set linkIsBlank = element.link_type is defined and element.link_type == constant('MonsieurBiz\\SyliusRichEditorPlugin\\Form\\Type\\LinkTypeType::TYPE_EXTERNAL') %}

- {{ element.label }} + + {{ element.label }} +

diff --git a/src/Resources/views/Admin/UiElement/image.html.twig b/src/Resources/views/Admin/UiElement/image.html.twig index bb7513ad..1ffc6b24 100644 --- a/src/Resources/views/Admin/UiElement/image.html.twig +++ b/src/Resources/views/Admin/UiElement/image.html.twig @@ -6,13 +6,15 @@ alt title link + link_type align #} {% if element.image is defined %} {% set align = element.align is defined and element.align is not empty ? element.align : 'inherit' %}

{% if element.link is not empty %} - + {% set linkIsBlank = element.link_type is defined and element.link_type == constant('MonsieurBiz\\SyliusRichEditorPlugin\\Form\\Type\\LinkTypeType::TYPE_EXTERNAL') %} + {{ element.alt|default('') }} {% else %} diff --git a/src/Resources/views/Shop/UiElement/button.html.twig b/src/Resources/views/Shop/UiElement/button.html.twig index 97d2fe1d..8a29cba7 100644 --- a/src/Resources/views/Shop/UiElement/button.html.twig +++ b/src/Resources/views/Shop/UiElement/button.html.twig @@ -4,9 +4,11 @@ element fields : label link + link_type align #} {% set align = element.align is defined and element.align is not empty ? element.align : 'center' %} +{% set linkIsBlank = element.link_type is defined and element.link_type == constant('MonsieurBiz\\SyliusRichEditorPlugin\\Form\\Type\\LinkTypeType::TYPE_EXTERNAL') %}

- {{ element.label }} + {{ element.label }}

diff --git a/src/Resources/views/Shop/UiElement/image.html.twig b/src/Resources/views/Shop/UiElement/image.html.twig index bb7513ad..1ffc6b24 100644 --- a/src/Resources/views/Shop/UiElement/image.html.twig +++ b/src/Resources/views/Shop/UiElement/image.html.twig @@ -6,13 +6,15 @@ alt title link + link_type align #} {% if element.image is defined %} {% set align = element.align is defined and element.align is not empty ? element.align : 'inherit' %}

{% if element.link is not empty %} - + {% set linkIsBlank = element.link_type is defined and element.link_type == constant('MonsieurBiz\\SyliusRichEditorPlugin\\Form\\Type\\LinkTypeType::TYPE_EXTERNAL') %} + {{ element.alt|default('') }} {% else %}