I have an entity_reference field in a content type:
In the field definition, it can reference all the nodes of a given type.
The widget used for this field is a
Depending the context, in the node edit form, I would like to use different views to populate the
#options of the
Context A --> View A will be used
Context B --> View B will be used
The context is calculated in my business logic (I speak about it to show that multiple views can be used and then, it can't be encoded in the field definition)
#options are already populated and I can't update the select widget array to populate them with a custom view. I assume, I have to hook before, but I don't know how.