Is the drupal_image() responsive parameter example correct?

Created on 24 April 2023, over 1 year ago
Updated 27 May 2023, over 1 year ago

Problem/Motivation

The Cheat Sheet has the following example:

{# Render responsive image. #}
{{ drupal_image('public://ocean.jpg', 'wide', responsive=true) }}

But the third parameter is $attributes, so is this correct and magic?

Steps to reproduce

Proposed resolution

Shouldn't this be

{# Render responsive image. #}
{{ drupal_image('public://ocean.jpg', 'wide', {}, responsive=true) }}

or

{# Render responsive image. #}
{{ drupal_image('public://ocean.jpg', 'wide', {}, true) }}

instead?

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

3.0

Component

Documentation

Created by

🇩🇪Germany Anybody Porta Westfalica

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

Comments & Activities

Production build 0.71.5 2024