- 🇦🇺Australia acbramley
Looking through how EntityReferenceEntityFormatter works and thinking about possible solutions I'm not sure this is actually achievable without some form of jankiness.
Entity reference fields can allow multiple bundles. If I allow 2 bundles with different "active" view modes, how do we determine what to show in the view mode options?
EntityDisplayRepository
does havegetViewModeOptionsByBundle
(the formatter currently usesgetViewModeOptions
which returns all view modes for the entity type), but again we'd have to combine them for each bundle that's configured for the field, etc.Given configuring views is a site builder task, and the Views UI will show a preview, it's simple enough to swap the view mode if it doesn't look correct?
I'm going to close this as works as designed given the length of time since it was last commented on it doesn't seem like a highly desirable change.
Please feel free to reopen if you disagree.
- 🇯🇴Jordan Rajab Natshah Jordan
Noted;
Thanks, Adam, for following up.
We're implementing a custom-coded solution for this:Example: List of default ignored view modes.
This is being handled using multiple _form_alter() hooks in forms.Maybe the allowed/ignored list could be stored within the same field-form config settings (for fields).