9 – What does the “Views: Filter by an entity reference view” reference method do?


In your Entity Reference Field settings the Default method will allow all of the entities of the type you specified to be eligible to be referenced.

If you’re setting up your ER field to reference Taxonomy terms of a certain vocabulary then all of the terms from that Vocabulary will be able to be chosen inside that field.

If you want more control over which items should be eligible you can use Views to create a Display of type Entity reference.

Views module allows you to build various lists of entities. You can add filters and narrow down the list to the items you need in a specific case.

If you want a list of 10 specific Taxonomy Terms from a Vocabulary that contains 100 terms you can use Views to build it.

Usually you build Views Displays of types “Page” and “Block”. But there is also the option to build “Entity reference” Display.

The “Entity reference” Display type has some special settings that other displays don’t have, and they control what the list of entities should look like in the context of using that list in an ER field on a CT.

So once you create one Entity Reference Display type in Views, set it to filter the same type of items as an ER field in your Content Type, you will be able to return to your ER field settings and choose that Views Display as the field reference method.

This means that the entities offered to be chosen through the ER field when creating a new node will be only the entities from the Views you had created. If you had narrowed down the list of entities in the ER Views Display to only 3 items, then only those 3 items will be available in the ER field when creating a new node.

The Views Display must be Saved before it can appear in the ER field settings. When creating the View you choose the type of entities that will be listed, for example Taxonomy terms, and after the View has been created you can add a new Display to the Views, choose “Entity reference” from the list of the offered Views Displays (different Views Displays are shown as tabs on the Views Edit page).