The Entity reference field, covered in Chapter 2, The Content Authoring Experience, can utilize a custom view for providing the available field values. The default entity reference field will display all available entities of the type it is allowed to reference. The only available filter is based on the entity bundle, such as only returning Article nodes. Using an entity reference view you can provide more filters, such as only content that user has authored.
In this recipe we will create an entity reference view that filters content by the author. We will add the field to the user account form, allowing users to select their favorite contributed content.
The entity reference field definition provides selection plugins. Views provides an entity reference selection plugin. This allows entity reference to feed data into a view to receive available results.
The display type for Views requires you to select which fields will be used to search against when using the autocomplete widget. If not using the autocomplete widget and using the select list or checkboxes and radio buttons, then it will return the view's entire results.
Entity reference view displays can accept contextual filter arguments. These are not dynamic, but can be passed manually through the field's settings. The View arguments field allows you to add a comma separated list of arguments that are passed to the view. The order should match the order of the contextual filters as configured.
In this recipe we could have added a Content: type contextual filter that fell back to Display all results if the argument was missing. This allows the view to be reused in multiple references. Perhaps there is one view that should limit the available references to all Articles created by the current user. You would then add Article to the text field and pass the argument to the view.