Skip to content
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

Content list changes #1265

Merged
merged 1 commit into from
Sep 4, 2024
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
4 changes: 2 additions & 2 deletions templates/block/block--content-list.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
{% for item in items %}
{# Skip unpublished items if the user is not logged in #}
{% if item.entity.status.value == 1 or user.isAuthenticated %}
{% set image = item.entity.field_ucb_article_thumbnail.entity.field_media_image ?? item.entity.field_ucb_person_photo.entity.field_media_image ?? item.entity.field_how_to_initial_image.entity.field_media_image ?? item.entity.field_social_sharing_image.entity.field_media_image %}
{% set image = item.entity.field_ucb_article_thumbnail.entity.field_media_image ?? item.entity.field_ucb_person_photo.entity.field_media_image ?? item.entity.field_how_to_initial_image.entity.field_media_image ?? item.entity.field_social_sharing_image.entity.field_media_image ?? item.entity.field_collection_item_thumbnail.entity.field_media_image %}
{% if image %}
{% set imageURI = image.entity.fileuri|image_style('focal_image_square') %}{% set imageAlt = image.alt|render %}
{% endif %}
{% set summary = item.entity.body.0.summary ?? item.entity.field_ucb_article_summary.0.value %}
{% set summary = item.entity.field_collection_item_summary.0.value ?? item.entity.body.0.summary ?? item.entity.field_ucb_article_summary.0.value %}
{% if not summary %}
{% set body = (item.entity.body.0 ?? item.entity.field_ucb_article_content.0.entity.field_article_text.0).value|render|replace({" ": ""})|striptags|trim %}
{% set bodyTrimmed = body|slice(0, 512) %}
Expand Down
Loading