Let's say we have 3 custom entities:

enter image description here

When creating a new operator, I need to autocomplete the license:

enter image description here

By default we can use the autocomplete to find by name. So, we need to type the name to display the related results.

But here I'd like to autocomplete by authority name instead (since a license has no name).

Is it possible? If so, how to do it?

  1. Create a new view with the display type "Entity Reference"
  2. Add "Fields", "Filter criteria" and "Sort criteria" like in any other normal view
  3. Under "Format > Settings", select the fields you want to be searchable
  4. Under "Show > Settings", select the fields you want to show as search result
  5. Save the view
  6. Now visit "Structure > Content type > NODETYPE > Manage fields"
  7. Edit your entity reference field, set the "Reference Method" to "Views: filter by an entity reference view"
  8. Select your previously created view
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.