In a content type, and a field is an entity reference to another content type (the professionals companies).
I created a view, to display: first: the professionals flagged as favorite; then all the others.
Then comes my problem:
How can I create a selection of professionals like this:
- If user click on the "empty" field (empty before selecting): the list of favorites appears (this can be the first 10 of my view)
- the user can type and like autocomplete, the results are shown.
- if no favorite found, then comes a text (with link) to add node (create a new professional).
In the widget type of the entity reference:
- I tried "autocomplete" but the 1. doesn't work (user is obliged to type before something shows)
- I tried "view" but it's even worse (and the search is difficult)
- I tried "select list" but it doesn't allow to search.
I forgot to specify: The 3 options should be on the same field. So, when user click on the field to select (the company), the behavior of the field to select the garage should be like this:
- User clicks on it: user's favorites companies appears (through view)
- If the company he wants was not flagged as favorite, he can start to type in the field and the results appears (classic behavior in Drupal).
- If the name of the company he types doesn't exist, the field shows "no result" and show a link to create a company.