Template customization
Historical. This chapter describes ezcomments, the comments extension of the eZ Publish years. It is not part of Exponential 6 and the text below is kept for readers of older sites only.
In Exponential 6, comments are items of the Comment class, placed below the page they belong to, so the usual content policies decide who may write, approve or remove them. Editors moderate them in the administration or, on the site, below the fields of the website sidebar's Page panel. See Comments on your blog in the help center and The website sidebar.
Historical text
Like Exponential template customization, the Comments module can also be customized to fit further demand. Below are some examples to show how to customize the comment template.
Example 1: Change adding comment form to top
Create an override of template/content/datatype/view/ezcomcomments.tpl, and copy the code of ezcomcomments.tpl to the new template file.
In the new template file, cut this code
{* Adding comment form START *}
......
{* Adding comment form END *}to be before
{* Displaying comments START *}Example 2: Add comment attribute into existing class
You can also add a comment attribute into an existing class. After adding the Comments attribute and if the content view template shows ezcomments attribute, the comment list and comment form will be added into the content. Remember to clear cache after editing class.
In the Exponential web interface, for instance, the article class does not show all the attributes. In order to show the comment, you can add this code into an overridden full/article.tpl:
{attribute_view_gui attribute=$node.data_map.comments}
{* 'comments' is the attribute identifier in the class *}Example 3: Change notification template
You can change the notification template by change template in
template/comment/notification_subject.tpl template/comment/notification_body.tpl
If AllInOne is false in settings/ezcomments.ini.append.php.
If AllInOne is true in settings/ezcomments.ini.append.php, you can change template in
template/comment/notification_multi_body.tpl template/comment/notification_multi_subject.tpl
Contributors
- Andrea Melo Updated
- Graham Brookins
Comments
Add a comment