Inconsistent `attributes` handling

Created on 22 October 2024, about 1 year ago

Problem/Motivation

Some components initialize its own attributes, no ways to pass the `attributes`. Eg. card

Other inherits parent component/container `attributes`, e.g. Image component:
When image component is used inside a component or a container with `attributes`, the `attributes` being consumed by the image component due to components/image/image.twig:35

{% set image_attributes = fallback_attributes.merge(attributes ?: []) %}

Steps to reproduce

  • Have a parent component or template (e.g. paragraph) that contains `attributes`.
  • Include an image component.
  • Image component uses the `attributes` not meant for it.

Proposed resolution

Standardize all components implementation, use a unique `COMPONENT_attributes`, which can be passed `attributes` as needed.

Remaining tasks

-

User interface changes

-

API changes

-

Data model changes

🐛 Bug report
Status

Active

Version

6.0

Component

Code

Created by

🇲🇾Malaysia ckng

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