Skip to content

Commit 0dee544

Browse files
authored
Removed placeholder image (#198)
Removed placeholder image
1 parent cdf1ccb commit 0dee544

2 files changed

Lines changed: 23 additions & 30 deletions

File tree

website/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ function createAposConfig() {
5555
'@apostrophecms/image-widget': {
5656
options: {
5757
className: 'bp-image-widget',
58+
placeholderImage: false,
5859
},
5960
},
6061
'@apostrophecms/video-widget': {
Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,25 @@
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' %}
125

13-
{% set attachment = apos.image.first(data.widget._image) %}
6+
{% set attachment = apos.image.first(data.widget._image) %}
147

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+
/>
3325
{% endif %}

0 commit comments

Comments
 (0)