Allow component variants without twig template

Created on 30 November 2022, almost 2 years ago
Updated 16 January 2023, almost 2 years ago

It is already possible to define a component variant without a twig template. It is shown and processed correctly in storybook and also loaded correctly by drupal when embeding like '[COMPONENT]--[VARIANT]'. So far so good.

Unfortunately this results in a warning:
Warning: file_get_contents(themes/custom/scp/templates/components/molecules/menu/menu--header-bar.twig): Failed to open stream: No such file or directory in Drupal\cl_components\Component\ComponentMetadata->detectNamedBlocks() (line 314 of modules/contrib/cl_components/src/Component/ComponentMetadata.php).

The Provided MR falls back to the "default" variant when no template is available, which hopefully does not break any other integration and does like it meant to be.

Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

🇩🇪Germany Hydra

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024