Allow selecting the variant from WebformEntityReferenceItem

Created on 2 April 2025, 6 months 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.

  • Status changed to Closed: won't fix 13 days ago
  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY

    There is already a mechanism to create webform nodes with variants. I agree that improving the UI/UX would be nice, but I don't think there is enough interest in this feature/enhancement.

  • Now that this issue is closed, please review the contribution record.

    As a contributor, attribute any organization helped you, or if you volunteered your own time.

    Maintainers, please credit people who helped resolve this issue.

Production build 0.71.5 2024