Listings, Views
The Lupus Decoupled Views submodule provides support for Drupal's Views module. The Views module is Drupal's native way and very powerful way of creating listings of content. It provides a UI for configuring complex queries, searches and the rendering of results, including paging.
As alternative to Views-based listings, the frontend may create custom routes and listings by querying the backend, see JSON-API, GraphQL.
Usage
After enabling the sub-module, create a view, skip the wizard and follow the following steps:
- Add a
Custom Elements Pagedisplay to a view (not a regular page!). - Select
Custom elementsstyle as view format. - Select
Contentas row style. Choose the view-mode you want to use for the listed elements. - Configure filters and other options as needed and set a path for the view.
- The Custom elements API of the view is available at
/ce-api/<view-path>. Take note of the custom element name visible in the output, which will bedrupal-view-{ID}-page, with underscores in the view ID turned into dashes. - On the frontend clone the
drupal-view--defaultcomponent and create a component using the noted custom element namedrupal-view-{ID}-page. Test the view on the frontend at the configured path<view-path>and customize the component as desired.
Note that the chosen view-mode is automatically rendered with custom elements within the view. It's not required to force rendering it via custom elements.
To serve a view at its own path without a page around it, e.g. for random content or lazy loading, use a Custom Elements partial display instead, see Partials.
Video tutorial
In the following tutorial an example configuration can be followed: 
Note: The tutorial uses drupal-view as custom element name. Use drupal-view-{ID}-page instead (underscores in the view ID turned into dashes), or stay with the default drupal-view--default.
Status
- Support for Views is rather new and problems may arise with certain configurations. Please report any issues in the Lupus Decoupled Drupal issue queue.
- Atm there is no support for rendering exposed filter forms. So those need to be added manually in the frontend, when needed.
- The Row style
Fieldsis not supported yet (see #3461874). - Items formatted as
Rendered entitiesare supported. These are needed for Search API Index Views.