An easy to use comment system

This is YACS (yet another comment system) which tries to

  • (a) be easy to use,
  • (b) scale up to lots of comments
  • (c) provide different layouts and commenting requirements and
  • (d) implement a moderation workflow for comments before they go live.

MetaCommentPlugin allows to easily add commenting to any topic. Discussiosn can either be displayed in linear or threaded mode. Different comment styles and layouts can easily be created and switched from one to the other. Comments can be edited and deleted inline easily. Commenting can be enabled independently from the normal change access rights to a topic while they are still stored as meta data to a topic. That way a keyword search matching on different comments of the same discussion will generate a hit on the discussion itself in a natural way.



Data Model

Each comment is stored into a META:COMMENT field of a topic with properties

  • name: id of the comment, used in ref for threaded comments
  • author: WikiName of the author of this comment
  • date: timestamp when this comment was created
  • modified: timestamp when this comment was last modified
  • ref: name of another comment within the same thread this comment is a subcomment of
  • text: the comment text
  • title: title text of this comment

Configuring the comment system

Using MetaCommentPlugin on NatSkin

The easiest way to switch on commenting on a page is when using it together with Foswiki:Extensions/NatSkin. When opening the topic editor, there's a "Settings" tab that allows you to switch on and off commenting, switch between different commenting styles as well as configure moderation.

Using MetaCommentPlugin on PatternSkin

On a standard PatternSkin install you will have to use preference variables to control the system. First, to enable commenting add the metacomment skin overlay to your SKIN variable in SitePreferences.

   * Set SKIN = metacomment, pattern

To display the comment interface like shown above you need to set the preference variable:


There are a couple of formats how comments are displayed on the topic:

   * Set COMMENTFORMAT = threaded

Other values:
  • linear: list comments in linear order, i.e. there are no replies to comments directly
  • threaded (default): nested commenting; allows to reply on a reply
  • reverse: list comments in linear order in reverse twitter-like fashion
  • insidetab: list comments inside a tab at the bottom of the page; only available when used together with Foswiki:Extensions/TopicInteractionPlugin)

A discussion can be either open or closed:

   * Set COMMENTSTATE = open

By setting this to closed comments gathered so far are still listed while the form to add more comments is hidden

These preferences can of course be set per topic or added to the WebPreferences in case you want to enable commenting on all of the web.


MetaCommentPlugin separaters permission to comment on a topic from plain change access rights of a topic. That way you may restrict write access to a topic while still open it up for commenting to a wider audience. This is done by using a separate COMMENT access control list. Given the current topic is write restricted only allowing the original author to make changes, the following setting will permit commenting:

   * Set ALLOWTOPICCOMMENT = <comma separated list of users and/or groups>

See AccessControl for more information on setting up access control lists for various use cases.


Moderating comments allows you a bit more control of which comments are approved to be okay to be displayed to the public. This is mostly used on public environments to hide comments until they are approved by a list of moderators. Only the original author and moderators will see unapproved comments. For everybody else, unapproved comments are hidden until they are approved.

To enable moderation set the COMMENTMODERATION preference setting (defaults to off):


The list of people allowed to moderate a comment is configured by using Foswiki's permission system using the MODERATE role. So to configure moderators per topic use:

   * Set ALLOWTOPICMODERATE = <comma separated list of users and/or groups>
   * Set DENYTOPICMODERATE = <comma separated list of users and/or groups>

Or use a per web configuration in the WebPreferences using

   * Set ALLOWWEBMODERATE = <comma separated list of users and/or groups>
   * Set DENYWEBMODERATE = <comma separated list of users and/or groups>

See AccessControl for more information on setting up access control lists.


Renders a discussion on a given topic



  • topic: the topic to render the discussion for, defaults to the current topic
  • header: string prepended to the output
  • footer: string appended to the output
  • format: format string used to render each comment, defaults to <h3>$title</h3>$text
  • template: template to be used instead of the inline format parameter
  • separator: separats the list of comments
  • subheader: string prepended to the list of subcommnets, defaults to <div class='cmtSubComments'>
  • subfooter: string appended to the list of subcommnets, defaults to </div
  • subformat: format string used for subcomments, defaults to the value of the format parameter
  • ref: only list comments that are a subcomments of the given comment
  • skip: number of comments to skip in the list, useful for pagination
  • limit: maximum number of comments to list, useful for pagination
  • singular: title used when only one comment is present, defaults to One comment
  • plural: title when there are more than one comment, defaults to "$count comments
  • mindate: minimum date of a comment to be displayed
  • maxdate: maximum date of a comment to be displayed
  • threaded: switch on/off threaded rendering, comments will be rendered recursively
  • sort: specify the way comments are sorted; possible values: name (default), date, modified, author
  • reverse: switch on/off reverse order of sorted comments

When rendering a comment, the following variables can be used in the format strings:

  • $author: the name of the user that wrote this comment
  • $state: the state of this comment
  • $count: the total number of comments
  • $ismoderator: true/false if the current user is allowed to moderate the comments or not
  • $timestamp: the date when this comment was created; format in epoch seconds
  • $date: the date when this comment was created in Foswiki's default time format
  • $modified: the date this comment was last modified
  • $evenodd: expands to even or odd while formatting all comments in the list; useful to implement zebra striped comments
  • $id: the unique identifier of this comment (stored in the name attribute of the comment)
  • $index: the running number of the current comment while rendering a list of comments
  • $ref: the identifier of the comment this one is a reply to; used in threaded commenting mode
  • $text: the actual comment
  • $title: the title of the comment
  • $subcomments: expands to the list of all comments that are a reply to the current one

Installation Instructions

You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.

Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install".

If you have any problems, or if the extension isn't available in configure, then you can still install manually from the command-line. See for more help.


Author(s): Foswiki:Main/MichaelDaum
Copyright ©: 2009-2012, Michael Daum
License: GPL (Gnu General Public License)
Release: 1.10
Version: 13602 (2012-01-10)
Change History:  
10 Jan 2012: 1.10 - added german translation; added missing dependency on Foswiki:Extensions/RenderPlugin; backwards compatibility to older foswiki engines; adjusted index handler to latest changes in SolrPlugin; improved print css; fixed js error together with newer jquery versions
10 May 2011: 1.00 - partial rewrite to use Foswiki:Extensions/JsonRpcContrib; renamed preference COMMENTAPPROVAL to COMMENTMODERATION
20 Apr 2011: fixed error in regular expression
15 Apr 2011: using CPAN:JSON to properly encode json-rpc data; fixed recoding of received data to the site's own charset; improved the way photos are gathered
Foswiki::Plugins::ZonePlugin>=3.1Required. required for Foswiki < 1.1
Home page: Foswiki:Extensions/MetaCommentPlugin
Support: Foswiki:Support/MetaCommentPlugin

I Attachment Action Size Date Who Comment
MetaCommentPlugin.md5md5 MetaCommentPlugin.md5 manage 0.2 K 10 Jan 2012 - 19:40 MichaelDaum  
MetaCommentPlugin.sha1sha1 MetaCommentPlugin.sha1 manage 0.2 K 10 Jan 2012 - 19:40 MichaelDaum  
MetaCommentPlugin.tgztgz MetaCommentPlugin.tgz manage 63.2 K 10 Jan 2012 - 19:40 MichaelDaum  
MetaCommentPlugin.zipzip manage 71.0 K 10 Jan 2012 - 19:40 MichaelDaum  
MetaCommentPlugin_installerEXT MetaCommentPlugin_installer manage 5.1 K 10 Jan 2012 - 19:40 MichaelDaum  
Edit | Attach | Print version | History: r26 | r8 < r7 < r6 < r5 | Backlinks | View wiki text | Edit WikiText | More topic actions...
Topic revision: r7 - 10 Jan 2012, MichaelDaum

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License