Configuring Entity Reference View Widget

Last updated on
30 April 2025

You are browsing documentation for an older version of Drupal, which is not supported any longer, and the information may not be correct. See current documentation for Contributed modules

The process below documents how to set up and configure the Entity Reference View Widget.

1) Create a new view

Create a new view with no display:

Go to Administration >> Structure >> Views >> Add new view (path: admin/structure/views/add)

Step 1

Give the view an unique name and select which "Entity/content" / "Type" you want to display.

Unselect "Create a page" and "Create a block"

Press "Continue & Edit"

Note: There is no need for a page or a block, but if you happen to be displaying the same entity type as one of these then you can of course have all displays in the same view.

2) Add "Entity Reference View Widget" as a Display type

Step 2

The next steps can vary depending on your personal needs.
I wanted to show a simple list and not the "Rendered Entity"

view settings
Checkbox settings
View "Format" >> select "Table"

View "Fields" >> I added the following

- Entity Reference View Widget Checkbox: Content (Important since, this will add the checkboxes of the items you want to select as references)
- Title

Check that "Use Ajax" is set to "Yes", otherwise your view will behave strangly when trying to page, filter, ...

Next press "Save" to save the changes for the view

3) Edit your Content Type or Entity
Add or Edit the field with "Entity Reference"

Next make sure your "field" - "widget type" is set to "View"
Widget Type

Administration >> Structure >> Content types >> Product display >> Manage fields (in my example)
CT edit
Check for the following "field" settings in your content type field:
- "View": make sure you select your "Entity Reference View Widget"
- Pass selected entity ids to view
field settings
field settings
Press "Save settings"

And now you are done.

-----------

Go to existing Node / Entity to "add items" (References) to it.
Edit Content

Add items triggers the Overlay with the view in it
View widget in action

After selection
Content referenced

EXTRA
-----------

Add filter options (which is like adding a filter to any view)

1) Edit your view and "Entity Reference View Widget" as a Display type

2) Add a "FILTER CRITERIA" to the view

Select the desired field you want to filter on, next press "Apply"
Only local images are allowed.
Select the desired operator
Make sure you expose your field to the visitors, next press "Apply"
filter operator

Let assume we want to add our "Title" field as a filter
And use the operator "Contains"

Next press "Save" to save the changes for the view

And now you are done.

-----------

Go to existing Node / Entity to "add items" (References) to it.
On top of the overlay, you now the filter options.

view with filter

Help improve this page

Page status: Not set

You can: