Online Articles Publishing: a work-flow tutorial

I believe I now have the tools necessary to do what I want, so that I can share with everyone the method for doing what I want. And that, namely, is publishing content. Oh yes, Drupal can already do that. But I want to moderate content. Yes, Drupal can do that too…but not really. Unless, of course, you give your content moderators ‘administer nodes’ privileges and basically give them complete access to all content on the site. That’s hardly right. I wanted to be able to give editorial control of certain sections to people who were not necessarily site administrators.

The Tools

  • Views
  • Dashboard
  • Node Queue
  • Workflow
  • Actions
  • na_arbitrator
  • workflow_access
  • some custom code, which I’m calling publishing.module

That’s a pretty long list of tools. If you’ve been reading my previous articles, you already know what some of this stuff is for, and I don’t really need to get into how Views is used, and what Node Queue is good for. Workflow, however, is something I haven’t particularly talked about, and it is something that can be extremely useful, but currently lacks a little bit of support.

[Editor's Note: These patches have now been committed, and you should no longer need them. The text of the paragraph is left for reference.] First, you need to be sure to get my patches for Workflow. If they are not already committed, you need the comment history patch and the _submit patch. The latter patch lets it work with the na_arbitrator and workflow_access modules. Now those are bleeding edge access control modules but they do seem to work and need some good burn-in testing to get the wrinkles out.

The Recipe

  1. Install all of the above modules.
  2. Go to Workflow and create a new workflow. Call it Publishing unless you like something else more.
  3. Add the following roles: content author, editor. Attach the permissions from the publishing module to these roles.
  4. Don’t confuse the role, ‘content author’ with the ‘author’ role which means author of the node. All we’re really going to use ‘content author’ for is to control the ability to actually create the content.
  5. Add the following states: Draft, Review, Rework and Published.
  6. Allow the following transitions: (creation) => Draft: author. Draft => Review: author. Review => Rework: author, editor. Review => Published: editor. Published => Rework: Editor.
  7. Set the following permissions: Draft: author view/update/delete; editor view. Review: author view; editor view, edit, delete. Rework: author view, edit; editor view; Published: anonymous view, authenticated view. [nobody gets edit privs on published content].
  8. Edit the publishing module to ensure that the State IDs in the defines are the same as in your database.
  9. Create a user and give it author privileges. Go to the author dashboard and submit some content. Set it for review.
  10. Create a user and give it editor privileges. Go to the editor dashboard and review the content. Publish it.

Unpublished content isn’t visible on the system, so you don’t really have to worry about it. You can organize the content by whatever traditional means you like. In order to create the front page I like:

Create a node queue named Lead Articles. Give it a maximum of 3 or so.

Create a dashboard. In the top, use the dashboard to display only the article in the back of the lead article queue, and display the teaser. On the left side of the dashboard, display the remaining teasers. On the right side of the dashboard, use Views to display content by your favorite taxonomy categories.