Move some logic from the template to .module

Created on 27 September 2024, about 2 months ago

Problem/Motivation

The template of the block contains some logic that can be moved to .module file

 {% set safe_hash = configuration['block_revision_id'] ~ '--' ~ loop.index %}
                {# Setup our image style. #}
                {% set media_image = ''%}
                {% set image_desktop = ''%}
                {% if item.field_media.entity.field_media_image.entity.uri.value %}
                  {% set media_image = item.field_media.entity.field_media_image.entity.uri.value %}
                  {% set image_alt = item.field_media.entity.field_media_image.0.alt %}
                {% endif %}

                {% if media_image %}

Proposed resolution

Move that logic to the .module file directly.

πŸ“Œ Task
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine aleevas

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024