Moderating Comments with CoreBlog2 - Part 2

In a previous entry, I proposed a fairly simple way to moderate comments.  But it was really just a way to get at a checkbox interface to delete comments.  I didn't like that spam comments were live until I deleted them.  I've come up with a better way where comments aren't shown until I approve them.  Here's how.

Create a new COREBlog comments workflow

  • Log into the ZMI. 
  • Navigate to portal_workflow. 
  • Switch to the Contents tab. 
  • Check the box next to plone_workflow and hit the Copy button. 
  • Once the page reloads, hit the Paste button. 
  • Once the page reloads, check the checkbox next to the copy_of_plone_workflow and hit the Rename button. 
  • Rename our new workflow to cb_comment_workflow and click OK.

Set the COREBlog comments workflow's initial state to pending

  • Click on the cb_comments_workflow link. 
  • Switch to the States tab. 
  • Check the checkbox next to pending and click the Set Initial State button.

Make the pending state invisible to everyone except managers and reviewers for the new workflow

By default, Plone makes the pending state visible to everyone, which I think is a bad idea.  It's not explicit, but rather a result of the pending state inheriting permissions from its parent.  We are going to change this for our new workflow.

  • Click the pending link on the States list you are now viewing. 
  • Switch to the Permissions tab. 
  • Uncheck all checkboxes in the Acquire permission settings? collumn and click the Save Changes button.

 

Set the COREBlogComment type to use your new cb_comment_workflow

  • Navigate back to the root portal_workflow page.
  • In the list, find COREBlogComment (COREBlog Comment).
  • Change (Default) to cb_comment_workflow.
  • At the bottom of the page, click the Change button.

 

That's it, you're done.

Now, when someone or some bot leaves a comment, it will go into your approval list.  Until you  or another Reviewer/Manager approve the comment, it won't be live.

 

 Update - May 11, 2006

I would suggest also changing COREBlogTrackback to use this workflow to prevent trackback spam.

  1. David G (not verified)
    Tue, 08/14/2007 - 2:11pm
    Thank you Martin! I've been messing around in the ZMI to try to stumble on a way to curb spamming on my site and then I found your idea. Very detailed writing and easy to follow. David PS not a big deal, you may want to edit above you wrote "cb_comments_workflow" and below you wrote, "cb_comment_workflow"
  2. Sudhakar (not verified)
    Wed, 08/20/2008 - 5:15am
    Hi When ever I try to add a comment it redirects me to credentials_cookie_auth page asking userid and password. How to get rid of this problem?