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.
The link function l() in Drupal 7 has been replaced in Drupal 8 with an object oriented approach. Adding a query and class to the link is no longer obvious.