bamboo_render_image not displaying alt text

Created on 19 April 2023, over 1 year ago
Updated 30 August 2023, about 1 year ago

Problem/Motivation

When using the bamboo_render_image function, "img" elements contain a blank alt attribute, even though alt text is provided via the media library.

Steps to reproduce

Example code snippet:

{% set media = bamboo_load_entity('media', paragraph.field_image.target_id) %}
{{ bamboo_render_image(media.field_media_image.target_id, 'banner_medium') }}

Results:
<img src="/sites/default/files/styles/banner_medium/public/2023-03/2020-02-25%2014.15.55.jpg?itok=lGRstvmR" width="665" height="354" alt="" loading="lazy" class="image-style-banner-medium" />

Proposed resolution

  • Adding a new alt on bamboo_render_image.

Remaining tasks

  • Review and tested by the community

User interface changes

None

API changes

  • New Optional property alt on bamboo_render_image. Eg. {{ bamboo_render_image(1, 'thumbnail', 'Dignissim (...) primis') }}

Data model changes

None

🐛 Bug report
Status

Fixed

Version

6.0

Component

Code

Created by

🇬🇧United Kingdom thatlotnextdoor

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

Comments & Activities

Production build 0.71.5 2024