Last week at a local Drupal User Group I saw a presentation about new and experimental features that will be in Drupal 8.3 and two of them got me very intrigued - Workflow and moderation.
It got me thinking about how we handle the content approval workflow in Joomla and what can we do to improve the entire process to make it as powerful, flexible and easy to use as we possibly can.
What is a Content Workflow?
On many sites, especially within a corporate environment - although the same will apply to a web site with mutliple languages - we need a process before content can be published and viewable by the public. In other words before a content item can be published it needs to pass along a workflow.
How can we do this?
Currently within Joomla we have the ability, using the ACL (access control system), to give a user the ability to create content in only the unpublished state. We also have the ability for all admins to be notified when new content is created. These admins can then login - check the content and publish it.
At this point the content item will show who created it and who was the last person to edit it (ie the person who wrote it and publsihed it). Using "versions" we can also see what changes have been made to the content, by whom and when.
So far so good?
This works in a simple two step process of creator and publisher but it is still limited. If the creator comes back and edits/updates the now published article it doesn't go through another review process. More importantly the details of the last person to touch the article are updated so we lose the information about who approved the content and when they approved it.
What about a three step or more workflow process?
In some scenarios you might have a content creator, a graphics creator, perhaps a translator, a legal approval and finaly a publishing approval. Can Joomla handle this workflow as well. Out of the box it would currently appear not to be possible - or is it?
Recording the steps in the workflow
We would need a method to record/log the progress of the content item as it moves through the workflow. As I stated above we can't use the "modified by" field alone for this as it doesnt keep a full history - it only records the last change. I thought we would need some new code for this part but we don't.
We can do this using the versions and version note capability we already have in Joomla. Yes it can be improved to make it better but the core code needed to record the steps is already there.
One way to improve this would be not to use the version note field (especially as its a free text field) but instead to use the new core feature of content field groups and fields. We can create a new field group called workflow with all the required fields needed to truly record the steps.
Notifications
We would need a method to notify people that there is new content that they have to take an action on. As you know we have the ability to notify users when a new article is submitted in the frontend of your site. So we have the basics of a notification system but it would need to be improved in one, perhaps two areas.
Selective notification
We don't need to notify all users that there is new content. We only need to notify the next user in the process. As we already have a notifcation system I am confident that it would not be too much to build in checks as to which user to notify in what sequence. After all we only want to notify the next user in the workflow when the previous user has marked the content in some way as ready for the next stage. So for example the notification workflow would be as follows:
- Content Created -> Notify Graphics group
- Graphics Created -> Notify Legal group
- Legal Approved -> Notify Publisher group
- Published -> Optionaly notify subscribed users of new content
Notification Message
Joomla will currently simply send a message that says
Title: A new private message has arrived from Website
Content: Please login to read your message
This part really would need to be revamped but then even without this workflow concept it could do with modernising. The subject really should be more descriptive and the content more than just a login to check your messages but perhaps directly to the content item. But we have the basics.
Improve the Content Creation UI
Yes we could change the default "save" button depending on the stage of the workflow. Perhaps to use specific buttons as below
Improve the dashboard
How about a module on the control panel when you login that shows all the content waiting for you to action. That's pretty easy to do - it would just be an extra paramater to the existing administrator Articles module.
Managing the Process
This would be the part that would need some new code. At least from a User Interface perspective to make the management of the process easier.
It would live under the Users menu and be called Workflow. Here we could create the User Groups, Assign users to those groups AND define what the groups can do and in what order. This is where we would define the workflow structure as I described in the Selective Notifications process above.
The more automated we make this process the easier it becomes to create even the most complex workflow.
So you can see we already have in the core of Joomla everything we need to start building complex Content workflows. We just need to glue it all together with a user interface and tweak some existing code.
This is the experimental Drupal interface for managing this process. Simple isn't it?