Providing an entity reference result view
Entity reference fields allow you to reference other entities. Often, this is used with content to reference taxonomy terms or related content. By default, the entity reference will display all the available entities that can be referenced. However, using the Views module and its entity reference view display type, you can provide a more controlled result.
In this recipe, we will create an entity reference view that filters references based on content created by the current author. We will then add a field to the user account form, allowing users to select their favorite contributed content.
How to do it…
- Go to Structure and then Views. This will bring you to the administrative overview of all the views that have been created. Click on Add view to create a new view.
- Set View name to My Content Reference View and keep the current View settings configuration.
- Do not choose to create a page or block. Click on Save...