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