Populate Props with data from *.components.yml file when it is provided

Created on 12 September 2024, 3 months ago
Updated 17 September 2024, 3 months ago

Problem/Motivation

The Styleguide Demo form appears to assume that props must have data provided by the user in order to view a component.

This is not always the case.

Steps to reproduce

    Install Drupal Core 10.3
    Select the Olivero theme as the default theme (it contains a component)
    Install and enable sdc_components version 1.1+

Expected Behavior:

  • Teaser component would automatically pick up the defined classes from the component twig template, and not require input from the user, especially since the only accommodation on this particular component is the class, which is hard-coded into the component's twig template

Actual behavior:

  • Even though the template's class is hard-coded into the template itself, the user must provide values in the Attributes properties. Providing a class attributes (example: class="drupal-teaser" results in broken markup for the element's provided attributes. In this case the broken attribute markup appears as class="drupal-teaser" teaser", where "drupal-teaser" is the user provided class, and "teaser" is the hard-coded class in the component's twig template
πŸ› Bug report
Status

Fixed

Version

1.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States lhridley

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

Comments & Activities

Production build 0.71.5 2024