Create a View of Moderated Content for Drupal 8, Drupal 9

Last updated March 18, 2021
Site Administration8.9.x/9.0.x

The Content Moderation module exposes data about a content item's moderation state to Views. That allows us to use that information when building custom views. The data includes a moderation state field, filter, and a relationship to the moderation state entity.

In this tutorial we'll:

  • Build a new view that uses the moderation state field and lists all revisions for a content item
  • Display that view as a block which can be shown on any content page

By the end of this tutorial you'll know how to use the moderation state field in a view.