Skip to content

Commit fad2c26

Browse files
authored
[Twig] Removed usage of deprecated spaceless filter (#58)
1 parent bdcd7af commit fad2c26

File tree

1 file changed

+31
-37
lines changed

1 file changed

+31
-37
lines changed

src/bundle/Resources/views/fields/content_fields.html.twig

+31-37
Original file line numberDiff line numberDiff line change
@@ -3,47 +3,41 @@
33
{% extends "@IbexaCore/content_fields.html.twig" %}
44

55
{% block ezobjectrelationlist_field %}
6-
{% apply spaceless %}
7-
{% if not ibexa_field_is_empty( content, field ) %}
8-
<ul {{ block( 'field_attributes' ) }}>
9-
{% for contentId in field.value.destinationContentIds %}
10-
{% if parameters.available[contentId] %}
11-
{{ ibexa_http_cache_tag_relation_ids(contentId) }}
12-
<li>
13-
{{ render( controller( "ibexa_content::viewAction", {'contentId': contentId, 'viewType': 'embed', 'layout': false} ) ) }}
14-
</li>
15-
{% endif %}
16-
{% endfor %}
17-
</ul>
18-
{% endif %}
19-
{% endapply %}
6+
{% if not ibexa_field_is_empty( content, field ) %}
7+
<ul {{ block( 'field_attributes' ) }}>
8+
{% for contentId in field.value.destinationContentIds %}
9+
{% if parameters.available[contentId] %}
10+
{{ ibexa_http_cache_tag_relation_ids(contentId) }}
11+
<li>
12+
{{ render( controller( "ibexa_content::viewAction", {'contentId': contentId, 'viewType': 'embed', 'layout': false} ) ) }}
13+
</li>
14+
{% endif %}
15+
{% endfor %}
16+
</ul>
17+
{% endif %}
2018
{% endblock %}
2119

2220
{% block ezimageasset_field %}
23-
{% apply spaceless %}
24-
{% if not ibexa_field_is_empty(content, field) and parameters.available %}
25-
{{ ibexa_http_cache_tag_relation_ids(field.value.destinationContentId) }}
26-
<div {{ block('field_attributes') }}>
27-
{{ render(controller('ibexa_content::embedAction', {
28-
contentId: field.value.destinationContentId,
29-
viewType: 'asset_image',
30-
no_layout: true,
31-
params: {
32-
parameters: parameters|default({'alias': 'original'})|merge({'alternativeText': field.value.alternativeText })
33-
}
34-
}))}}
35-
</div>
36-
{% endif %}
37-
{% endapply %}
21+
{% if not ibexa_field_is_empty(content, field) and parameters.available %}
22+
{{ ibexa_http_cache_tag_relation_ids(field.value.destinationContentId) }}
23+
<div {{ block('field_attributes') }}>
24+
{{ render(controller('ibexa_content::embedAction', {
25+
contentId: field.value.destinationContentId,
26+
viewType: 'asset_image',
27+
no_layout: true,
28+
params: {
29+
parameters: parameters|default({'alias': 'original'})|merge({'alternativeText': field.value.alternativeText })
30+
}
31+
}))}}
32+
</div>
33+
{% endif %}
3834
{% endblock %}
3935

4036
{% block ezobjectrelation_field %}
41-
{% apply spaceless %}
42-
{% if not ibexa_field_is_empty( content, field ) and parameters.available %}
43-
{{ ibexa_http_cache_tag_relation_ids(field.value.destinationContentId) }}
44-
<div {{ block( 'field_attributes' ) }}>
45-
{{ render( controller( "ibexa_content::viewAction", {'contentId': field.value.destinationContentId, 'viewType': 'text_linked', 'layout': false} ) ) }}
46-
</div>
47-
{% endif %}
48-
{% endapply %}
37+
{% if not ibexa_field_is_empty( content, field ) and parameters.available %}
38+
{{ ibexa_http_cache_tag_relation_ids(field.value.destinationContentId) }}
39+
<div {{ block( 'field_attributes' ) }}>
40+
{{ render( controller( "ibexa_content::viewAction", {'contentId': field.value.destinationContentId, 'viewType': 'text_linked', 'layout': false} ) ) }}
41+
</div>
42+
{% endif %}
4943
{% endblock %}

0 commit comments

Comments
 (0)