Allow to use rendered entities (in selected view mode) as webform entity checkboxes / radios options

Created on 20 August 2024, 3 months ago
Updated 21 August 2024, 3 months ago

Problem/Motivation

Webform provides several entity reference selection elements like:

  • webform_entity_checkboxes
  • webform_entity_radios

for example.

For our use-case, we'd like to show the rendered entities instead of their label in a certain view mode ("card").

I neither could find a setting for that nor a contrib module solving that.

Modules like

allow rendering a selected entity in a webform, but not as checkboxes / radios values.

The rendering should happen in the form, not in the submissions display.

Am I missing something or isn't this feature existing yet?

(Of course, this is not a request for the maintainer to implement this, but to ask if this feature would be accepted by the maintainer and to ensure it's not already solved somewhere and I didn't find it.)

Thank you!

Steps to reproduce

Add an entity reference webform element to the webform like Entity radios or Entity checkboxes and try to render the referenced entity instead of the label as options.

Proposed resolution

  1. Provide a setting to select if the label or the rendered entity (in a selected view mode) should be used as options
  2. Render the entity as options in the selected view mode, if that option is chosen

Remaining tasks

  1. Ensure the feature doesn't already exist
  2. Get green light from maintainer
  3. Implement
  4. Test
  5. Release

User interface changes

API changes

Data model changes

✨ Feature request
Status

Active

Version

6.3

Component

Documentation

Created by

πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

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

Comments & Activities

  • Issue created by @Anybody
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Sorry, I found it!

    Reference method: Views filter by an entity reference view

    does the trick!
    No idea why I didn't see that for hours...

    So the question is: Should I prepare a MR to add some lines of description to the form to let the users know about this, when using the regular reference method?

    Something like:
    For more advanced use-cases like rendered entities or more complex entity filtering or sorting, you may want to use the "Views filter by an entity reference view reference method."

  • πŸ‡¨πŸ‡¦Canada Liam Morland Ontario, CA πŸ‡¨πŸ‡¦

    Sure, better documentation is welcome.

  • πŸ‡¨πŸ‡΄Colombia i'mbatman

    i'mbatman β†’ made their first commit to this issue’s fork.

Production build 0.71.5 2024