Measure node completion in Drupal, part 3

Peter Vanhee
12 Apr 2010
6 Comments
Peter Vanhee
12 Apr 2010
6 Comments
Peter Vanhee, 12 Apr 2010 - 6 Comments

Measure node completion in Drupal, part 3

Setting up an editor workflow using Rules and Content Complete

This is the third part of the series on Content Complete. If you have missed the introduction of the Content Complete module, please read the first part in this series.

Thanks to the integration with the powerful Rules module, you can set up complex workflows with data completion in a couple of minutes. I'll show you how to set up email reminders sent automatically to authors of incomplete Album nodes (< 100%).

If you're not familiar with the Rules modules, please read this introduction and check out tutorials here.

Workflows on data completion using Rules

You need to download and install the Rules module (Rules, Rules Administration UI, Rules Scheduler), the Views module and the Token Module.

First, we will create a rule set that will continuously reschedule itself until the node is completed.

  • Go to "admin/rules/rule_sets/add" and fill out the label with "CC Check (Set)" and the machine-readable name with "cc_check".
  • In the "Arguments" fieldset select "Content" and "User".
  • Back on the Rule Set page, click on the freshly created set and click "Add a new rule". Set the label to "CC Check".
  • Every rule works with conditions (IF) and actions (THEN). Add the condition "Content Complete % is >= than x" and fill out 100 under "% to compare". Click on "Negate" such that our condition translates to "if Content Complete % < 100".
  • Add the action "Send a mail to a user". As recipient, select the content's author. Fill out the subject with for example "Complete your node [node:title]" and the message with something like "Click on [node:site-url]/node/[node:nid]/edit to complete your node." Check out the Token Replacement Patterns for more options.
  • We need to reschedule our rule continuously. Add another action "Schedule 'CC Check (Set)'", give it an identifier "CC Check '[node:title]'" and as scheduled evaluation date put "+1 day". Make sure you have cron configured to have email reminders sent out daily.

Rule configuration with conditions (node of type 'Album' updated) and actions (run CC Rule Set)

We now have a rule set that checks the completion of the node and, if needed, sends an email reminder to the author of that node. Now we need to trigger that rule set on a Drupal event, for example, every time a node of type 'Album' is updated.

  • Go to "admin/rules/trigger/add" and fill out the label with "CC Check". As a trigger event, we choose "After updating existing content".
  • Add the condition "Content has type" and select the "Album" content type.
  • Add the action "CC Check (Set)" with Content set to "created content" and User set to "content's author".

Rule configuration with conditions (node of type 'Album' updated) and actions (run CC Rule Set)

Test your new workflow by writing an additional message to watchdog and setting the scheduled evaluation date to for example "+1 min". You can also enable the debugging mode of the Rules module: at the settings page click on "Debug rule evaluation".

Future of Content Complete: a Complete API

Checking completion for content is just one approach to having your Drupal websites as "complete" as possible. We have already experimented with different ways of "completion", e.g. by counting user actions as steps in processes that need completion. If you're interested in for example having your users each add 3 nodes of type 'Album' and every node at least filled for 75%, check out the Complete module. That module is related to the Content Complete module, but measures completeness of actions (as measured by the Rules module) instead of completeness of nodes. A combination of both modules can lead to a "Complete API" and some preliminary ideas are under discussion here. Looking forward to your feedback!

Comments

Comments

everlearner
14 Oct 2010

Hi Peter,

Thank you very much for this tutorial. It is very useful for me and other drupalers.

May I request one more tutorial, about "User Profile Completeness" using "Content Complete + Content Profile + Rules"? I hope this will also help to the Drupal Community.

Thanks again for your informative and useful tutorial.

Hi Peter,

Thank you very much for this tutorial. It is very useful for me and other drupalers.

May I request one more tutorial, about "User Profile Completeness" using "Content Complete + Content Profile + Rules"? I hope this will also help to the Drupal Community.

Thanks again for your informative and useful tutorial.

everlearner, 14 Oct 2010

Hi Peter,

Thank you very much for this tutorial. It is very useful for me and other drupalers.

May I request one more tutorial, about "User Profile Completeness" using "Content Complete + Content Profile + Rules"? I hope this will also help to the Drupal Community.

Thanks again for your informative and useful tutorial.

everlearner, 14 Oct 2010
Anonymous
12 Feb 2011

Hello Peter very good Tutorial just a question if I used the date module with a start and end date how would I use rules to work with content complete.

Hello Peter very good Tutorial just a question if I used the date module with a start and end date how would I use rules to work with content complete.

Anonymous, 12 Feb 2011

Hello Peter very good Tutorial just a question if I used the date module with a start and end date how would I use rules to work with content complete.

Anonymous, 12 Feb 2011
Peter Vanhee
12 Feb 2011

You could use rules to execute an action whenever either start or end date are completed, or both. As far as I know, you could also use the values of start and end to add more advanced logic, but this goes then outside the scope of the Content Complete module.

You could use rules to execute an action whenever either start or end date are completed, or both. As far as I know, you could also use the values of start and end to add more advanced logic, but this goes then outside the scope of the Content Complete module.

Peter Vanhee, 12 Feb 2011

You could use rules to execute an action whenever either start or end date are completed, or both. As far as I know, you could also use the values of start and end to add more advanced logic, but this goes then outside the scope of the Content Complete module.

Peter Vanhee, 12 Feb 2011
Peter Herrmann
8 Mar 2011

Hi Peter, Ich have changed the color of the content-complete-percent-bar in the content_complete.css. One question: Is it possible to change the color of the bar programmatically? i.e. The bar reaches 100% and switch from red to green. Looking forward to hear from you Thanks a lot in advance Regards Peter

Hi Peter, Ich have changed the color of the content-complete-percent-bar in the content_complete.css. One question: Is it possible to change the color of the bar programmatically? i.e. The bar reaches 100% and switch from red to green. Looking forward to hear from you Thanks a lot in advance Regards Peter

Peter Herrmann, 8 Mar 2011

Hi Peter, Ich have changed the color of the content-complete-percent-bar in the content_complete.css. One question: Is it possible to change the color of the bar programmatically? i.e. The bar reaches 100% and switch from red to green. Looking forward to hear from you Thanks a lot in advance Regards Peter

Peter Herrmann, 8 Mar 2011
Tafa
15 Apr 2011

Hello,

I have a problem using this module. Basically, I have 5 user roles. For each type of user, there is specific set of CCK fields to fill in in their content profile form. My problem is that if I use the content complete module on the content type itself, none of my users would be able to reach 100% even though they have filled in their set of CCK fields. So my question is how can I make sure that content complete reflect the correct state of a content type for a particular group of users? I hope this is easy to understand as I am, myself, struggling to put everything in words. Thanks T

Hello,

I have a problem using this module. Basically, I have 5 user roles. For each type of user, there is specific set of CCK fields to fill in in their content profile form. My problem is that if I use the content complete module on the content type itself, none of my users would be able to reach 100% even though they have filled in their set of CCK fields. So my question is how can I make sure that content complete reflect the correct state of a content type for a particular group of users? I hope this is easy to understand as I am, myself, struggling to put everything in words. Thanks T

Tafa, 15 Apr 2011

Hello,

I have a problem using this module. Basically, I have 5 user roles. For each type of user, there is specific set of CCK fields to fill in in their content profile form. My problem is that if I use the content complete module on the content type itself, none of my users would be able to reach 100% even though they have filled in their set of CCK fields. So my question is how can I make sure that content complete reflect the correct state of a content type for a particular group of users? I hope this is easy to understand as I am, myself, struggling to put everything in words. Thanks T

Tafa, 15 Apr 2011
Andrea Pescetti
23 Nov 2011

Comments are closed. You can contact Peter through his drupal.org contact form. To contact the current Nuvole team, use the contact form on this site instead.

Comments are closed. You can contact Peter through his drupal.org contact form. To contact the current Nuvole team, use the contact form on this site instead.

Andrea Pescetti, 23 Nov 2011

Comments are closed. You can contact Peter through his drupal.org contact form. To contact the current Nuvole team, use the contact form on this site instead.

Andrea Pescetti, 23 Nov 2011

Get your project started today!

Contact us