Improving the authoring experience and editorial workflow with ECA

Image
A tree with media and documents as fruit on its branches

I recently was presented with a relatively simple problem, and decided to explore ECA as a possible solution. The initial problem was a pretty simple use case, and could have been accomplished with a bit of custom code. With the move of this blog to Drupal, we built a simple editorial workflow to give our marketing team some guardrails and control over the publishing process. Since the launch, we've decided to expand this workflow from Draft -> Review -> Published, to include a new state - "Technical Review". The new flow will be Draft -> Technical Review -> Review -> Published.  

Managing Technical Reviewers and expanding the Workflow

To facilitate Technical Review I added the Workflow Participants module. This allows an author to designate editors or reviewers to perform a Technical Review of the post before sending it on to Marketing for them to review and publish. Unfortunately the authoring experience out-of-the-box was lacking, as the Workflow Participants module adds a local task rather than extending the edit form, so the author would have to know to click that tab to add their technical reviewers. 

To solve for this, I turned to ECA. I created a simple model that triggers when the blog transitions to the "Technical Review" state. When that event fires, the ECA model redirects the author to the "Workflow Participants" URI and sets a message to direct the author on how to add Technical Reviewers.

ECA model for Technical Review

 

Building further to tackle new challenges

This simple model solved our initial problem. With that out of the way, I was presented with our next issue. To keep display of blogs consistent on the site we want to ensure every post has media, but we did not want to make the media field required. To make the authoring experience as smooth as possible, we want our staff to be able to login and start writing a post with as few hurdles as possible. Forcing them to find and add media to their post just to save the first draft would be a hurdle. I wanted a more elegant solution than making the field required, or having to contact authors and ask them to add media further down the line.

To solve this, I added another model in ECA. This model triggers when an author transitions their post to Technical Review. On transition it checks to see if the media field is empty, and if it is then the model sets a message asking the author to add an image, sets the state of the post back to Draft, and redirects the author back to the edit form.

ECA model to require an image for state transition

 

With this new flow, the media field is now a "soft" requirement. You don't have to add media to create a blog or edit the draft, but when you are done and you want to send the post for review you're given direction and need to add the image to proceed. 

Bringing it all together

I tied both of these flows together by adding a check on the Technical Review model to check for media as well, so now if there is media and you move to Technical Review you're redirected to add Workflow Participants, and if there isn't an image you're redirected back to the edit view and asked to add an image.

Finally, I simplified this into one model which is represented like this:

ECA model that combines two flows

 

While all of this could have been done with a custom module and some code, ECA made it quick and easy to prototype and implement a solution, then to expand on that for new use cases. This has helped improve the authoring experience and workflow for both our authors and our editors on the marketing team.