"A Drupal 8 initiative to improve Drupal's content workflow", this is how Dries Buytaert first defined the Workflow Initiative, back in 2016. Now, coming back to 2018, you must be asking yourself a legitimate question: “How do I set up a content workflow in Drupal 8?”
“How do I manage, extend and customize an editorial workflow to fit my Drupal 8 website's publishing needs? One including multiple users, with different permissions, that manages the workflow status of... different content types.”
Which are the (not so) new content management features and functionality implemented to Drupal core by now? Those aimed at improving the user experience (editors, content authors...)?
Let's get you some answers:
1. Introducing: The Content Moderation Drupal 8 Module
Content Moderation has reached stable version in Drupal 8.5.
Why should you care? What makes this core module of critical importance for creating your content publication workflow?
- because otherwise, you'd have only two built-in states to “juggle with”: published and unpublished
- because it enables you to build a simple workflow for drafts, too
- … to set up new custom editorial workflows, as well, in addition to the default one
In short, what this module does is that it enables you to create a flexible content workflow process where:
- one of the editors in your team stags a “Draft” content
- and another user on your Drupal 8 website, with a different permission, reviews/updates it
It comes as a powerful tool for you to leverage when your workflow needs are more complex than “ON/OFF”.
2. How to Set Up a Simple Content Workflow in Drupal 8
You'll only need 2 modules for putting together the workflow for a basic content publishing scenario:
- Workflows, that will provide just the framework needed for managing the states and transitions included in the process
- Content Moderation, which will add the “Draft” state, a “Draft to Published” content workflow, and an admin view for handling all the drafts
And here's setting up a basic content publishing workflow in 4 simple steps:
- Enable the “Content Moderation” core module
- Go to “Configuration” and click the “Workflow” tab; it's the last one in the unfolding drop-down menu
- Open the “Workflows” page
- Tada! You've just turned on your default “Editorial workflow”
For now, you should be having 3 major states in your workflow:
Note: use permissions to grant content contributors the right to edit/create drafts, editors the “Transition drafts to published” permission, admins the right to “restore to draft transitions” and so on...
And voila! Your default editorial workflow, with the Content Moderation module ON, should suit your basic state tracking needs. It should fit any standard use case.
Now, if your workflow needs are a bit more complex and website-specific... keep on reading:
3. Content Revisions in Drupal 8
One of the most powerful features that Content Moderation will “turbocharge” your editorial workflow with is:
Saving each change as a content revision in the database.
It stores all revisions in the system.
But let's take a common scenario, shall we?
Let's say that a second editor decides to make an update to a piece of content (either a content type or a custom block type). He/she updates it, then saves it as a “Draft”. You'll then still have the published version of the content, that's live, on your Drupal website, as well as this Draft (or several of them), stored, as a revision, in your database.
A crucial functionality for any complex content publishing workflow:
- with content revisions, you get to keep track of who's updated what and when
- … to trigger log messages regarding those changes, informing other content authors that a given content has been edited
- and you can also revert to the oldest revisions if needed
4. How to Extend and Customize Your Content Publishing Workflow
Rest assured: there's no need for custom code writing, even if your content publishing needs are a bit more complex.
Here's what it takes to extend and to custom-tune your default content workflow in Drupal 8:
- While on your “Workflow” page, just click the “Add a new state” button and add more workflow states: “Needs Review” or “Second Review” etc.
- Next, make sure you adjust your transitions to support your newly added state(s). For instance, a “Second Review” state would require a “Move to Second Review” transition.
- Then, apply your extended workflow to either a specific content type or to a custom block type
- You can also create new separate content publishing workflows to have a different one for your press releases, a separate publishing workflow, an editorial workflow for your blog posts, a warehouse workflow etc.
Defining multiple workflows in Drupal 8, each one with its specific “ecosystem” of states and transitions, is now possible.
- the transitions in your workflow will stand for the permissions that you'll assign to different Drupal roles in your team
- use clear, descriptive verbs to name them
- remember to grant editors the permission to undo transitions, as well (they might need to revert a piece of content to “Needs Work” once they've reviewed it, for instance)
By defining multiple states for your piece of content (Published, Pending Review, Ready for Review, Ready for Second Review, Unpublished, Draft etc.) and managing the permissions corresponding to the state transitions you can build a content workflow in Drupal 8 capable to support even the most complex publishing scenarios.
Now, another common scenario where a custom content workflow in Drupal 8 is needed is when you have a website publishing content to multiple platforms.
You have a Drupal 8 website, a native application and an internal portal, let's say...
Your publishing workflow would look something like this:
- first, content gets moderated to be published on the front-facing Drupal website
- then, it gets put in the queue for review before it gets published (or declined) on each one of the other 2 platforms
Note: if you need to further extend your editorial workflow and to apply it to a custom entity, for example, you can always write a WorkflowType plugin that meets your specific needs.
Then, you can apply your custom workflow to... steps in ordering in a resto app, steps in a manufacturing process and to pretty much any entity (think beyond content) that needs to change its workflow states...
5. How Do You Know If You Really Need an Editorial Workflow?
Do you really need to use content moderation? To set up a whole workflow for your publishing scenario?
You do, if and only if:
- there are multiple content authors uploading content on your website, content that needs to be reviewed before it gets published
- you're managing a team of multiple admins, with different user roles
- each moderator knows his/her role in the publishing chain
But if the content authors in your team have the very same type of permission as the admins and they just push content through, a content moderation workflow is useless.
It would only slow down the publishing process.
So, just because you have the option to set up a content workflow in Drupal 8, doesn't mean that you should rush to implement it on your own website, too... Maybe you just don't need a workflow.
What do you think about these content management capabilities in Drupal 8? Are they powerful and diverse enough to suit your workflow needs?
We do Drupal development
Go to our Drupal page!