Creating a moderated comments system

20 January 2010 by Bob North

Here’s a quick trick that will make life easy when you want to keep control over what is be added to your site. I’m going to skip over the basic Content Management approval controls, which are documented elsewhere, and look at the form-based techniques that give you even more flexibility over your approval processes.

Let’s start with a simple typical scenario – a blog with a comments section, where you want to allow anyone to post a comment, but you want to approve (ie moderate) the posting before it shows up on the site. Later on we’ll extend this example to more complex setups, but this will explain the fundamentals.

So, for our blog, the comment postings will be stored in a neatComponents Form – with the usual fields of Comment text, Date, Posting (that it refers to), and so on.

The trick is to add a checkbox field, called say ‘Publish’, which is unchecked by default.

Then, when the Query that displays the comments is embedded on the page, add a criteria to only show records where the Publish checkbox field is checked.

Naturally it’s important that (a) the writer of the comment doesn’t see the Publish checkbox – or they could approve their own postings(!), and (b) the site administrator does get to see the Publish checkbox, to approve them.

This is achieved by using two Data Entry Forms, both linked to the same underlying Comment Form. The first one is public facing, and doesn’t contain the Publish checkbox, whilst the other does show it, and has its Permissions set to only allow the site admin to access it.

For added sophistication it’s a trivial step to add an email to the Public Data Entry Form that sends the admin an email to alert when a comment needs moderating.

In my next posting I’ll be building on this simple example to look at scenarios where an item (probably not a blog comment, but, for example, a Press Release) needs to be approved by several people.


For those of you familiar with the free clearString system, it goes without saying that all this configuration is done without writing a single line of code, without any Linux haikus, and without breaking a sweat. If you’re new to the system see www.clearstring.com

 

Comments:

 

Categories:

 

Tags:

 

Archive:

July 2016
March 2016
May 2012
March 2012
February 2012
January 2012
December 2011
November 2011
September 2011
August 2011
July 2011
June 2011
May 2011
March 2011
October 2010
September 2010
August 2010
March 2010
February 2010
January 2010

 

Twitter:

 

Facebook:

 

 

 Website copyright and all rights reserved. - A blog made using clearString.

Admin