Skip to content

[Twig] Removed usage of deprecated spaceless filter #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 31 additions & 37 deletions src/bundle/Resources/views/fields/content_fields.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,41 @@
{% extends "@IbexaCore/content_fields.html.twig" %}

{% block ezobjectrelationlist_field %}
{% apply spaceless %}
{% if not ibexa_field_is_empty( content, field ) %}
<ul {{ block( 'field_attributes' ) }}>
{% for contentId in field.value.destinationContentIds %}
{% if parameters.available[contentId] %}
{{ ibexa_http_cache_tag_relation_ids(contentId) }}
<li>
{{ render( controller( "ibexa_content::viewAction", {'contentId': contentId, 'viewType': 'embed', 'layout': false} ) ) }}
</li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
{% endapply %}
{% if not ibexa_field_is_empty( content, field ) %}
<ul {{ block( 'field_attributes' ) }}>
{% for contentId in field.value.destinationContentIds %}
{% if parameters.available[contentId] %}
{{ ibexa_http_cache_tag_relation_ids(contentId) }}
<li>
{{ render( controller( "ibexa_content::viewAction", {'contentId': contentId, 'viewType': 'embed', 'layout': false} ) ) }}
</li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
{% endblock %}

{% block ezimageasset_field %}
{% apply spaceless %}
{% if not ibexa_field_is_empty(content, field) and parameters.available %}
{{ ibexa_http_cache_tag_relation_ids(field.value.destinationContentId) }}
<div {{ block('field_attributes') }}>
{{ render(controller('ibexa_content::embedAction', {
contentId: field.value.destinationContentId,
viewType: 'asset_image',
no_layout: true,
params: {
parameters: parameters|default({'alias': 'original'})|merge({'alternativeText': field.value.alternativeText })
}
}))}}
</div>
{% endif %}
{% endapply %}
{% if not ibexa_field_is_empty(content, field) and parameters.available %}
{{ ibexa_http_cache_tag_relation_ids(field.value.destinationContentId) }}
<div {{ block('field_attributes') }}>
{{ render(controller('ibexa_content::embedAction', {
contentId: field.value.destinationContentId,
viewType: 'asset_image',
no_layout: true,
params: {
parameters: parameters|default({'alias': 'original'})|merge({'alternativeText': field.value.alternativeText })
}
}))}}
</div>
{% endif %}
{% endblock %}

{% block ezobjectrelation_field %}
{% apply spaceless %}
{% if not ibexa_field_is_empty( content, field ) and parameters.available %}
{{ ibexa_http_cache_tag_relation_ids(field.value.destinationContentId) }}
<div {{ block( 'field_attributes' ) }}>
{{ render( controller( "ibexa_content::viewAction", {'contentId': field.value.destinationContentId, 'viewType': 'text_linked', 'layout': false} ) ) }}
</div>
{% endif %}
{% endapply %}
{% if not ibexa_field_is_empty( content, field ) and parameters.available %}
{{ ibexa_http_cache_tag_relation_ids(field.value.destinationContentId) }}
<div {{ block( 'field_attributes' ) }}>
{{ render( controller( "ibexa_content::viewAction", {'contentId': field.value.destinationContentId, 'viewType': 'text_linked', 'layout': false} ) ) }}
</div>
{% endif %}
{% endblock %}
Loading