Drupal Custom Contextual Filter

A custom contextual filter for Views in Drupal 8 is demonstrated using the Data project. Only a small amount of code is needed for the custom filter.

Set up Drupal

Begin by setting up Drupal and installing the Schema and Data projects.

composer create-project drupal-composer/drupal-project:8.x-dev contextual --no-interaction

Create a database and visit the website to install it. Now install a couple of contributed projects.

Decoupled Drupal, GraphQL and React

Decoupled Drupal is gaining increased interest.  Decoupling refers to using Javascript for the front end of the website and Drupal for the back end content.  Many of the tutorials leave out critical information and even quite recent tutorials are already out of date because the software is changing so quickly.  Developing a production website under these conditions is still risky but has intriguing possibilities.  Javascript avoids page reloads and promises increased speed and separation of the display from the data.  But building a display yourself loses things lik