Closed (fixed)
Project:
Component variants
Version:
1.0.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
7 May 2026 at 09:49 UTC
Updated:
22 May 2026 at 13:50 UTC
Jump to comment: Most recent
Sometimes we could skip invoking the variant selection hook and render a selected variant directly if variant information is given (for example via the #variant SDC renderable array key).
Let's check if we can do it in ComponentVariantsHooks::preRenderComponent(https://git.drupalcode.org/project/component_variants/-/blob/1.0.x/src/H...) to convert to what Drupal\component_variants\TwigLoader\ComponentVariantLoader expects.
Ability to select variant on renderable creation stage.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
graber commentedComment #5
s_leu commentedComment #6
graber commentedThought it'll be nice to add test coverage.