viewsreference
This field in conjunction with the Paragraphs module or Core's Layout Builder, makes for a very powerful content management system, allowing addition of just about any kind of content into an entity page.
Key features
- Allow editors to decide where and when to display Views in their site
- Allow editors to add as many different Views as they would like to a page when a site builder adds this field to a Paragraph or Layout Builder block for example
- Allow editors to decide which Display within a View to show (without this module, Core's entity reference would allow the View selection only)
- Allow editors to customise how each View is display with the use of the built in Settings plugins
- Allow developers to build out their own range of controls to give the editor, even leading to a sort of listing builder so editors can control content lists without needing to understand Views or be an experience Drupal site builder
- Automated test coverage to ensure you have a reliable tool for your sites
For a more complete comparison with other views-embedding modules please check the documentation.
How to use this module
- Add a Views Reference Field to any fieldable entity (like Node, Paragraph, Block, User, etc) via the 'Manage fields' tab of that entity
- Decide which Views to allow (or all) via the field settings
- Decide whether to give the editor control over these built-in settings
- View arguments (contextual filter)
- Showing the View title or not
- Setting the limit and/or offset
- Deciding how the pagination is displayed
- (Roll your own control, like filters to show, table columns to display, etc)
- Use 'Manage form display' to decide whether to use an autocomplete or a select list for the editor to choose the View
- Use 'Manage display' to decide whether to 'Lazy load' the View or render immediately
Add-on modules
- Views Reference Extras extends this module to handle complex configurations which can result in 414 errors but reloading the views reference configuration from the entity instead of compressing the configuration as is.
- Views Reference Field Filter extends this module by adding a filter plugin that grants control over exposed views filters.
1.x Branch
The 1.x branch does not have the Settings plugins and supports only the arguments and title field control (in addition to selecting the View and Display). It therefore also does not allow you to roll your own Settings as described above.
There is an upgrade path from 1.x to 2.x, but please backup your database before doing the upgrade to prevent possible data loss. Please also report any issues you may encounter during the upgrade.
Future development is focused on the 2.x branch.