Reader small image

You're reading from  Drupal 10 Masterclass

Product typeBook
Published inDec 2023
PublisherPackt
ISBN-139781837633104
Edition1st Edition
Tools
Concepts
Right arrow
Author (1)
Adam Bergstein
Adam Bergstein
author image
Adam Bergstein

Adam Bergstein is a product engineering leader and an architect. He has been a long-time Drupal community member, a routine speaker at Drupal community events around the globe, and provided keynotes for several events. He has maintained and contributed to many Drupal projects, including Password Policy, Taxonomy Menu, and more. Adam is the lead of Simplytest, a free service, and a project that offers Drupal community members testing sandboxes. He has also worked for both agencies building Drupal applications and Drupal service providers building Drupal-related products. He has led the Drupal Community Governance Task Force and is serving a term as a community board member of the Drupal Association.
Read more about Adam Bergstein

Right arrow

Content Workflows

Content often has to be reviewed and approved before publishing. Much like with print, editors perform reviews, request changes, or authorize content for publishing. Drupal offers a feature that allows content to go through a workflow before publishing. Leveraging roles and permissions, Drupal can customize workflows for various users during an editorial process.

In this chapter we’re going to cover the following main topics:

  • Configuring workflows
  • Using workflows

Configuring workflows

Content workflows in Drupal have two different modules relevant to configuration:

  • Content moderation, which offers additional publication states for content
  • Workflows, which manage state, transitions, and corresponding workflows

This section explores how those modules are configured to deliver workflows tied to Drupal content. It is broken down into subsections on the configuration needed to manage states, transitions, and workflows and with the user permissions required to grant specific roles.

Managing states

Workflows help define different states of content. Consider the different states of an article. A writer drafts content. An editor reviews the draft, may perform some editorial corrections, and approves or rejects it for publishing. The authored content may come in different states. This could be a draft state or an approved/published state, or it might get sent back to draft if it’s rejected.

Managing transitions

Transitions...

Using workflows

Workflow features are incorporated into Drupal’s standard content management capabilities. The community has contributed additional capabilities that can be added on. Some examples include the Scheduler module (https://www.drupal.org/project/scheduler), which integrates time-related events with the Content Moderation module, a bulk publishing module for use within Content Moderation (https://www.drupal.org/project/moderated_content_bulk_publish), and a notifications module also tied to Content Moderation (https://www.drupal.org/project/content_moderation_notifications). The following section highlights the usage of out-of-the-box content workflow features in Drupal only.

The main content listing has a new Moderated content tab for viewing workflow states within the content. It is found at admin/content/moderated and is shown in the following figure:

Figure 16.5 – Content overview for the Moderated content tab

Figure 16.5 – Content overview for the Moderated content tab

This listing...

Use case

Suppose a public company has regulatory compliance, requires all earning reports to go through a review, and has a specific publishing date. This example assumes the Content Moderation, Workflows, and Scheduler modules are enabled. The following steps can be done to configure this use case:

  1. Create an earnings report content type with any file fields configured to use the private filesystem from admin/structure/types/add
  2. Configure the earnings report content type to use the scheduler by enabling the checkbox Enable scheduled publishing for content items under the Scheduling tab when configuring the content type.
  3. Add a new regulatory workflow of type “content moderation” at admin/config/workflow/workflows with at least draft and published states and at least one transition from draft to publish.
  4. Select the earnings report content type when configuring the regulatory workflow.
  5. Create a role for the regulatory governing users.
  6. Assign relevant...

Summary

Workflows allow for content to go through editorial processes. By harnessing Drupal’s native users, roles, and permissions, site builders can configure states and transitions and control actions for each user, which can be applied to content entities and bundles. Like editorial processes for print, Drupal offers various checks done by different users before the content is published.

The next chapter explores advanced topics in Git, Drush, Composer, and DevOps that developers and operators should understand.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Drupal 10 Masterclass
Published in: Dec 2023Publisher: PacktISBN-13: 9781837633104
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
Adam Bergstein

Adam Bergstein is a product engineering leader and an architect. He has been a long-time Drupal community member, a routine speaker at Drupal community events around the globe, and provided keynotes for several events. He has maintained and contributed to many Drupal projects, including Password Policy, Taxonomy Menu, and more. Adam is the lead of Simplytest, a free service, and a project that offers Drupal community members testing sandboxes. He has also worked for both agencies building Drupal applications and Drupal service providers building Drupal-related products. He has led the Drupal Community Governance Task Force and is serving a term as a community board member of the Drupal Association.
Read more about Adam Bergstein