The second step is to set up the User Comments snippet.

The Structure

I'm going to keep this very simple, and let each post act as the folder to contain its comments. To do this, I simply add the UserComments snippet immediately after the [*content*] tag in the template. As mentioned before, you can also put the snippet in the document, if you don't want all documents using this template to have comments.

[!UserComments? &makefolder=`1`!]

The makefolder option causes the snippet to automatically make the parent document a folder, if it already isn't.

Now we have a basic system with public commenting for every page in our blog.

blog post

UserComments Options

  • &displaytpl - display template (chunk name)
  • &formtpl - form template (chunk name)
  • &canpost - comma delimitted web groups that can post comments. Leave blank for public posting
  • &canview - comma delimitted web groups that can view comments. Leave blank for public viewing
  • &badwords - comma delimited list of words not allowed in post
  • &makefolder - set to 1 to automatically convert the parent document to a folder. Defaults to 0
  • &folder - folder id where comments are stored
  • &tagid - a unique id used to identify or tag user comments on a page where multiple comments are required.
  • &freeform - set this option to 1 to use the [+UserComments.Form+] placeholder to relocate the comment form.
  • &postcss - sets the css class used to format the comment block DIV
  • &titlecss - sets the css class used to format the comment title DIV
  • &codecss - sets the css class used to format code tags
  • &numbecss - sets the css class used to format the comment number DIV
  • &authorcss - sets the css class used identify author's comments
  • &ownercss - sets the css class used identify the owner's comments
  • &altrowcss - sets the css class used shade alternate rows
  • &dateformat - sets php date format for new comments (see http://php.net/strftime for formatting options)
  • &sortorder - display the comments oldest first (0) or newest first (1). Defaults to newest first (1)
  • &recentposts - set the number of comments to be displayed. Set to 0 to show all comments. Defaults to 0

( back to top )