ibexa

Path

ez publish / user manual / 5.x / comments module / template customization


Caution: This documentation is for eZ Publish legacy, from version 3.x to 5.x.

Template customization

Like eZ Publish 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 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 (15/01/2013 2:46 pm)

Andrea Melo (22/01/2013 2:36 pm)


Comments

There are no comments.