jasonglisson
6/3/2015 - 10:45 PM

Drupal 7 - Directions for Entity Reference Field for Views

Drupal 7 - Directions for Entity Reference Field for Views

What you could do is create an entity reference list from a view and populate your widget with the view.

Create a new view Untick Create a block and Create a page Then click continue and edit. That should get you to the master view.

Click Add to add a new display and choose entity reference. Give your display a easily recognisable name. Add your fields/ filters etc and order them as required. I usually change the items to display under pager to display all items, but I'm not sure how required this is.

Under the Format heading beside Format, click settings and set your field(s) that are to be searched when auto-completing. Under the Format heading beside Show, click settings and set your fields to be inline. Save your view.

Now head over to edit your entity reference field. Assuming you already have your field pretty much set up the only bit you might need to change is under: Entity selection mode Choose: "Views: Filter by an entity reference view" Assuming your field reference target type and view list match up you should get a dropdown appearing under "View used to select the entities" with your newly created view listed in there. Choose it and save.