|
1 | | -{% if data.widget.aposPlaceholder and data.manager.options.placeholderUrl %} |
2 | | - <img |
3 | | - src="{{ data.manager.options.placeholderUrl }}" |
4 | | - alt="{{ __t('apostrophe:imagePlaceholder') }}" |
5 | | - class="image-widget-placeholder" |
6 | | - /> |
7 | | -{% else %} |
8 | | - {% set className = data.options.className or data.manager.options.className %} |
9 | | - {% set dimensionAttrs = data.options.dimensionAttrs or data.manager.options.dimensionAttrs %} |
10 | | - {% set loadingType = data.options.loadingType or data.manager.options.loadingType %} |
11 | | - {% set size = data.options.size or data.manager.options.size or 'full' %} |
| 1 | +{% set className = data.options.className or data.manager.options.className %} |
| 2 | +{% set dimensionAttrs = data.options.dimensionAttrs or data.manager.options.dimensionAttrs %} |
| 3 | +{% set loadingType = data.options.loadingType or data.manager.options.loadingType %} |
| 4 | +{% set size = data.options.size or data.manager.options.size or 'full' %} |
12 | 5 |
|
13 | | - {% set attachment = apos.image.first(data.widget._image) %} |
| 6 | +{% set attachment = apos.image.first(data.widget._image) %} |
14 | 7 |
|
15 | | - {% if attachment %} |
16 | | - <img class="{% if className %}{{ className }} {% endif %}{% if not data.user %}lozad{% endif %}" |
17 | | - {% if loadingType %} loading="{{ loadingType }}"{% endif %} |
18 | | - srcset="{{ apos.image.srcset(attachment) }}" |
19 | | - src="{{ apos.attachment.url(attachment, { size: size }) }}" |
20 | | - alt="{{ attachment._alt or '' }}" |
21 | | - {% if dimensionAttrs %} |
22 | | - {% if attachment.width %} width="{{ apos.attachment.getWidth(attachment) }}" {% endif %} |
23 | | - {% if attachment.height %} height="{{ apos.attachment.getHeight(attachment) }}" {% endif %} |
24 | | - {% endif %} |
25 | | - {% if data.contextOptions and data.contextOptions.sizes %} |
26 | | - sizes="{{ data.contextOptions.sizes }}" |
27 | | - {% endif %} |
28 | | - {% if apos.attachment.hasFocalPoint(attachment) %} |
29 | | - style="object-position: {{ apos.attachment.focalPointToObjectPosition(attachment) }}" |
30 | | - {%- endif -%} |
31 | | - /> |
32 | | - {% endif %} |
| 8 | +{% if attachment %} |
| 9 | + <img class="{% if className %}{{ className }} {% endif %}{% if not data.user %}lozad{% endif %}" |
| 10 | + {% if loadingType %} loading="{{ loadingType }}"{% endif %} |
| 11 | + srcset="{{ apos.image.srcset(attachment) }}" |
| 12 | + src="{{ apos.attachment.url(attachment, { size: size }) }}" |
| 13 | + alt="{{ attachment._alt or '' }}" |
| 14 | + {% if dimensionAttrs %} |
| 15 | + {% if attachment.width %} width="{{ apos.attachment.getWidth(attachment) }}" {% endif %} |
| 16 | + {% if attachment.height %} height="{{ apos.attachment.getHeight(attachment) }}" {% endif %} |
| 17 | + {% endif %} |
| 18 | + {% if data.contextOptions and data.contextOptions.sizes %} |
| 19 | + sizes="{{ data.contextOptions.sizes }}" |
| 20 | + {% endif %} |
| 21 | + {% if apos.attachment.hasFocalPoint(attachment) %} |
| 22 | + style="object-position: {{ apos.attachment.focalPointToObjectPosition(attachment) }}" |
| 23 | + {%- endif -%} |
| 24 | + /> |
33 | 25 | {% endif %} |
0 commit comments