Spotlight Workflow Module

Get Paid To Write Online

Get Paid to Write at Home

Get Instant Access

So far, we've been relying on the built-in "published" flag that Drupal provides for every piece of content. When it's unchecked on the node editing form, only users with the "administer nodes" permission are allowed to view the content. That's enough for some sites, but it doesn't give our writers and editors as much control as they need. For example, there's no way for a writer to mark a story as an in-progress draft and come back to it later. In addition, there's no easy way for an editor to tell a writer that an article needs more work—the editor must contact the author manually.

This problem is exactly what the Workflow module (http://drupal.org/project/work flow) was designed to solve. It allows site administrators to set up predefined steps, called states, through which every piece of content must pass before publication. A complex site with strict legal requirements might need "Editorial review," "Legal review," "Executive approval," and "Ready to publish" states. When a node is in one of those states, only users in specific roles are allowed to move it to the next state, ensuring that the right people give the content their stamp of approval before it goes live.

^-Article p-ubl caticr Article publication:

— Review Schedule:

Immediately

— Schedule for state change at: Aug iI 15 ; I 2008 I

please enter a ;imt in 24 hour (eg. HH:MM> format. If no Lime is included, the defau t will be midnight on the specified date. The current time is: Fri. 0B/1S/2Q0B - 10:25

Comment:

A torn me nt to put in the workflow log.

Figure 6-7. Workflow states selection

The selection of workflow states can be done directly during node creation and editing through a new fieldset added to the node form, as seen in Figure 6-7. Along with changing the state, a user can also leave a comment in the workflow log. This way others can see reasons or notes about a change. Workflow also allows users to schedule a state-change for a specific time. Moving a page from "Executive approval" to "Ready to publish," for example, can be scheduled for 8:00 a.m., even if the VP made the decision at 11:00 p.m. the previous night.

In addition to the node form controls, Workflow provides a tab to the node form next to the View and Edit tabs. This tab shows the same state and scheduling controls, along with the Workflow History log that tracks every state change and displays any comments that were left. An example of the log is shown in Figure 6-8.

A new story

View Edit Workflow

Current state: Approved

Workflow History

Date Old State New State By Comment

A new story

View Edit Workflow

Current state: Approved

Workflow History

Date Old State New State By Comment

Fri, 08/15/2008 -

16:42

Review

Approved

admin

Looks greati Time to publish.

Fri, 08/15/2008 -

16:42

Draft

Review

user

Fixed up the errors.

Fri, 08/15/2008 -

16:41

Review

Draft

admin

Needs a bit more work, just typos and grammar.

Fri, 08/15/2008 -

16:40

(creation)

Review

user

Figure 6-8. Workflow history log

Figure 6-8. Workflow history log

Even more important, the Workflow module can leverage Drupal's actions. Every time a node moves from one state to another, specific actions can be fired. For example, the legal department could be notified via email when an editor moves a node from "Editorial review" to "Legal review." When the vice president signs off on a new piece of content, moving it from "Executive review" to "Ready to publish," actions can automatically publish the node and promote it to the front page.

This combination of tools (Actions, Trigger, and Workflow) allows sites to use complex editorial processes and intricate approval mechanisms. Each type of content can even have a separate workflow. A streamlined process might make sense for blog posts, and a more rigorous approval system might be needed for official content like a site's "About us" and "Privacy policy" pages.

In addition to Workflow, the Workflow Access module is also included with the Workflow package. It can hide posts from users based on their roles and the current state of the content. In our complex example, only users with the "legal team" role might be given access to nodes in the "Legal review" state.

Was this article helpful?

0 0

Post a comment