Back to the Future IV
Feature
In previous episodes, Marty McFly time-traveled to 1955 … Oh wait, that’s the wrong article.
So: In the previous issue of Drupal Watchdog, we introduced the Content Preview System (CPS). With CPS you can preview a site as what it would look like in the future, and allow tracking changes to the site in so-called ‘site versions’. With this powerful concept, it is possible to view a site as it will look after the changes have actually been made. Once all interested parties are satisfied with the outcome, the site version is published and all the changes go “live.”
There are two main advantages to this approach: Being able to publish several things together in context (e.g., articles with supporting sidebar or news content, an article series, a feature gallery, etc.), and being able to tightly control the workflow of content that is shown publicly to your visitors.
While this concept for a single editor is already powerful, it really starts to shine once there is a content team.
And that’s what this article is about: Extending the workflow of CPS to work for teams with different roles, permissions, and responsibilities.
You Will Learn To:
- Set up CPS Workflow Simple for three different roles;
- Use CPS reviews to enhance your workflow;
- Set up an entity-based workflow that is part of the larger workflow;
- Extend workflows.
A Simple Workflow with CPS
In the following example, it is assumed that the entities you use are revisionable (e.g., use file_entity_revisions, taxonomy_revision, etc. modules) to make full use of CPS. Only revisionable entities will work with the CPS workflow.
To get started, download the CPS, Diff, and Drafty modules and have drush download any other dependencies:
$ drush dl cps drafty diff
$ drush -y en cps_workflow_simple cps_node diff
This will download the following modules to your code base: cps, ctools, diff, drafty, entity, entity_status, iib, mailsystem, mimemail, views
After this step you will see a nice “Site version” widget below the admin and shortcuts menus.