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
- Provide a setting to select if the label or the rendered entity (in a selected view mode) should be used as options
- Render the entity as options in the selected view mode, if that option is chosen
Remaining tasks
- Ensure the feature doesn't already exist
- Get green light from maintainer
- Implement
- Test
- Release
User interface changes
API changes
Data model changes
Issue fork webform-3469200
Show commands
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
anybodySorry, I found it!
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."
Comment #3
liam morlandSure, better documentation is welcome.
Comment #7
jrockowitz commentedMarking RTBC because this is a simple change that can be committed AS-IS.
Comment #8
anybodyThanks!!
Comment #10
jrockowitz commented