← All changes
|
modules/atomic-widgets/elements/atomic-image/atomic-image.html.twig
+6
-10
4.0.9
→
3.34.0-beta1
View file →
| @@ -1,17 +1,13 @@ | ||
| 1 | 1 | {% if settings.image.src is not empty %} |
| 2 | 2 | {% set id_attribute = settings._cssid is not empty ? 'id=' ~ settings._cssid | e('html_attr') : '' %} |
| 3 | - {% set has_link = settings.link and settings.link.attributes is not empty %} | |
| 4 | - {% if has_link %} | |
| 5 | - <{{ settings.link.tag | e('html_tag') }} | |
| 6 | - {{ settings.link.attributes | raw }} | |
| 7 | - class="{{ base_styles['link-base'] }}" | |
| 8 | - data-interaction-id="{{ interaction_id }}" | |
| 9 | - > | |
| 3 | + {% if settings.link.href %} | |
| 4 | + <a href="{{ settings.link.href }}" class="{{ base_styles['link-base'] }}" target="{{ settings.link.target }}" data-interaction-id="{{ id }}" data-interactions="{{ interactions | json_encode | e('html_attr') }}"> | |
| 10 | 5 | {% endif %} |
| 11 | 6 | <img class="{{ base_styles['base'] }} {{ settings.classes | join(' ') }}" |
| 12 | 7 | {% if not settings.link.href %} |
| 13 | - data-interaction-id="{{ interaction_id }}" | |
| 8 | + data-interaction-id="{{ id }}" | |
| 9 | + data-interactions="{{ interactions | json_encode | e('html_attr') }}" | |
| 14 | 10 | {% endif %} |
| 15 | 11 | {{ id_attribute }} {{ settings.attributes | raw }} |
| 16 | 12 | {% for attr, value in settings.image %} |
| 17 | 13 | {% if attr == 'src' %} |
| @@ -20,8 +16,8 @@ | ||
| 20 | 16 | {{ attr | e('html_attr') }}="{{ value }}" |
| 21 | 17 | {% endif %} |
| 22 | 18 | {% endfor %} |
| 23 | 19 | /> |
| 24 | - {% if has_link %} | |
| 25 | - </{{ settings.link.tag | e('html_tag') }}> | |
| 20 | + {% if settings.link.href %} | |
| 21 | + </a> | |
| 26 | 22 | {% endif %} |
| 27 | 23 | {% endif %} |