Caution: This documentation is for eZ Publish legacy, from version 3.x to 6.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.

Template customization

Like eZ Publish template customization, eZ Comments 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 eZ Publish 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

Andrea Melo (17/07/2012 7:58 am)

Andrea Melo (17/07/2012 7:58 am)


Comments

There are no comments.