Comments: Add a Comment Component - Documentation topics on: comment: add a comment component,contentlet,deprecated,macros,.

Comments: Add a Comment Component
Deprecated

** This macro has been deprecated **

This macro allows you to add a generic comment component to any contentlet in the system. These comments can be either moderated (creates a workflow) or unmoderated.

Macro Overview:

Syntax:

#comment($contentlet.inode)

Arguments:

* contentlet inode - This is the inode of the contentlet that will be commented.


Optional Parameters:

  • $commentForceLogin = 'true'
    (default false) would require a user to login before they can comment. Otherwise, show them a message and the link to the login page.
  • $commentDateDescending = true
    (default false) shows comments in date descending order rather then the default ascending order.
  • $copmmentStripHTML = 'true'
    (default false) will remove any html from the comment.
  • $commentAutoPublish (velocity variable not a parameter)
    Optional: Controls whether the comment is automatically published or not.
    Default: true
  • $commentUseCaptcha (velocity variable not a parameter)
    Optional: If set to "true" shows a captcha image to the comment's form, to validate human interaction
    Default: false
  • $commentTitle (velocity variable not a parameter)
    Optional: If set, that will be the name of the subject in the comment
  • $commentsModeration (velocity variable not a parameter) Optional: If set, that will be the name of the role to assign the workflow
  • $maxDepth (velocity variable not a parameter)
    Optional: If set, that will be the number of levels you could make a comment. Comments will be displayed in a threaded view - Comments in reply to other comments.
    Default: 1

Usage:

Use this macro if you want to add a form to comment a contentlet, the macro, will add a form to add new comments and list the comments order by publish date. Special Note: Also set the variable below to enable the audio captcha on Safari on Mac OSX.
#($commentUseAudioCaptchaHeight = 200)

Examples:

Example 1: A simple example using the required fields

#set($commentForceLogin = 'true')
#set($commentAutoPublish = 'true')
#set($commentUseCaptcha = 'false')
#set($commentStripHTML = 'false')
#set($commentTitle = 'This is the question to comment') #comment($content.inode)

Example 2: An example showing how to include one or more of the optional parameters

#set($commentForceLogin = 'true')
#set($commentAutoPublish = 'true')
#set($commentUseCaptcha = 'false')
#set($commentStripHTML = 'false')
#set($commentsModeration = 'Editor')
#comment($content.inode)

Example 3: How to set a path to you own commenting macro file to be used in place of the default dotCMS commenting macro

  #set($myContent = $ContentInode)
  #set($commentSourceCode = '/test/comments_list_only.vtl')
  #comment($myContent)
  <hr/>
  #set($commentSourceCode = '/test/comments_form_only.vtl')
  #set($commentAutoPublish = 'true')
  #comment($myContent)