Allow selecting the variant from WebformEntityReferenceItem

Created on 2 April 2025, 25 days ago

Problem/Motivation

Related to the ability to have a single form with multiple variants for different use cases, it would be useful if it were possible to select which variant was shown via WebformEntityReferenceItem, so that e.g. you could reuse the same form and be able to chose which variant is displayed per instance.

Proposed resolution

Provide an option in WebformEntityReferenceItem::settingsForm() to select the variant that is displayed.

Remaining tasks

Provide an option in WebformEntityReferenceItem::settingsForm() to select the variant that is displayed.
Add test coverage.

User interface changes

WebformEntityReferenceItem::settingsForm() would allow selecting which form variant was displayed.
Update the field formatters to render the selected variant.

API changes

TBD

Data model changes

TBD

✨ Feature request
Status

Active

Version

6.3

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

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

Comments & Activities

  • Issue created by @DamienMcKenna
  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY

    @damienmckenna I am hesitant to add new features, but maybe this is simple to implement, and the variant dropdown is only visible if the webform is using variants.

    The webform nodes 'References' kind of allows people to build nodes for different variants.

    β†’

  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY

    The challenge will be adding Ajax callbacks to the widget.

Production build 0.71.5 2024