Path

7x / documentation / ez publish / user manual / 6.x / comments module / configuration


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.

Configuration

This module provides some configurations to customize comment sorting, the number of comments per page, the notification format, etc. All of these settings are defined in settings/ezcomments.ini.append.php. For the full settings description please read ezcomments.ini.settings.

Set comment sort

You can change the sort order of comments in the content view, which has comments embedded, or in the comment view, which lists all comments in a separate page.

In the content view, the default setting is that comments are sorted chronologically by the commenting time in descending order. To change the sorting, you can override settings/ezcomments.ini.append.php as follows:

[GlobalSettings]
DefaultEmbededSortField=created
DefaultEmbededSortOrder=asc

The oldest comments will now be shown first in the content view.

Similarly, in the comment view, to change the sorting to update time in descending order you can override settings/ezcomments.ini.append.php as follows:

[CommentSettings]
DefaultSortField=modified
DefaultSortOrder=desc

Set number of comments shown in content

You can define how many comments are shown in the content by overriding settings/ezcomments.ini.append.php like this:

[GlobalSettings]
DefaultEmbededCount=15

This will display the 15 latest or oldest comments, depending on the sort setting defined in the content view.

Hide comment fields

By default, eZ Comments has some predefined fields in the comment form such as title, name, website, email, content. But often, you don't need this many fields. To hide fields, remove the unnecessary fields in settings/ezcomments.ini.append.php:

[FormSettings]
AvailableFields[]=title
AvailableFields[]=name
AvailableFields[]=website
AvailableFields[]=email
AvailableFields[]=comment
AvailableFields[]=notificationField

Afterwards, the removed field will not be shown in the comment form. But note that the field comment (comment content) can not be deleted.

Note: if email is removed but notificationField is kept, the anonymous user will not able to subscribe to comment updates when he/she comments. But a user who logged in can subscribe comment update using his/her registration email. In this case, editor can not update commentor's notification in comment editing page.

Configure activation settings

When an anonymous user comments on content with notification, the user should activate the subscription in order to receive a confirmation email. In addition, the activation link should expire after some time. You can configure the settings in settings/ezcomments.ini.append.php to enable the activation and set expiry time.

Enable activation

To disable the activation feature change the setting like this:

SubscriptionActivated=false

If the activation is disabled, the user can subscribe to comment updates without confirming his/her email address, although this is usually not considered safe or recommended.

Set expiry time

If a user does not activate the subscription in a set period of time, the activation should not remain valid. You can set expiry time by changing the setting like this

DaysToCleanupSubscription=20

In this example the activation will expire after 20 days.

Configure Notification email settings

When there is a new comment on a content, the user who has subscribed to the comment update should receive a notification. A typical setting for the notification is shown here:
 Email from: To change the 'from' in the notification email, you can override ezcomment.ini.append.php like this:

MailFrom=noreply@yourdomain.com

Multi-comment updates in one email: Some users don't want to receive an email every time a new comment is posted. You can easily configure the settings to avoid this:

CommentsInOne=true

When the value is set to true, the system will send a notification with all the updated comments inside.

Note: To ensure this setting makes sense, we suggest that ou set the eZ Comments cronjob to run infrequently, for example every day at 7:00 am. Otherwise the subscribers will still receive a notification every 5 minutes according to the setup setting. The infrequent cronjob setting might be like

0 7 * * * cd $EZPUBLISHROOT && $PHP  runcronjobs.php -q ezcomments 2>&1

Or you can just specify ezcomments cronjob to be infrequent by changing extension/ezcomments/settings/cronjob.ini.append.php to be:

[CronjobSettings]
ExtensionDirectories[]=ezcomments
[CronjobPart-infrequent]
Scripts[]=ezcomcleanupsubscription.php
Scripts[]=ezcomhandlenotification.php

Andrea Melo (15/01/2013 11:00 am)

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


Comments

There are no comments.