Chapter 10. Commenting

Commenting allows users to post comments on objects. Comments can be submitted via the template engine (in object view) as well as via the HTTP API.

Commenting is enabled by default, but can be disabled on a global basis in the Comments section of the Control Panel. This will prevent receiving of comments via all means, but will not affect output of comments that have already been stored.

In the template engine, ratings can also be disabled on a per-template set basis by removing any calls to $view->getHelper()->getHtmlCommentsSection() from the templates.

A commenting section can be included within an object view template (object/single.html.php and object/compound.html.php) using the $view->getHelper()->getHtmlCommentsSection() method call. This method will handle all aspects of generating the comment form and list of comments. You are free to style these however you wish using CSS.

dmBridge will post status messages to the flash in response to certain types of user input to this form - for example, when validation has failed or when the comment has been successfully posted. Therefore, when including comments in the template, it is a good idea to also include a call to $view->getHelper()->getHtmlFormattedFlash() in a conspicuous place in the template as well, in order to provide feedback to the user as to what has just happened in response to their input.

Comments can also be accessed and posted via the HTTP API.