Default settings from Constants¶
First of all, Configure Default settings in Constants
- Step 1: Go to Template.
- Step 2: Select root page.
- Step 3: Select Constant Editor from drop-down.
- Step 3: Select Constant Editor > PLUGIN.TX_NSCOMMENTS.
Here, you can configure the emails received by Admin when visitor add comment.
- Enable Mail: Check this checkbox to enable Email to Admin whenever any comment is posted.
- [TO] E-Mail: Set the Email address where Email should be sent. Generally it is Admin’s email.
- [TO] Admin Name: Set the Admin name.
- [FROM] E-Mail: Set From Email for email sent to Admin
- [FROM] Name: Set Sender Name for email sent to Admin
- Subject: Set Email Subject.
- Set Approval by admin: If this checkbox is checked, only those comments will be published which are enabled by Admin/System user. When visitor add any comment, by default, it will be disabled in backend. Once Admin/system user enables it, it will be displayed on page. If checkbox is unchecked, all comments posted by visitors will be displayed immediately on page.
- Terms required: Check this checkbox to add Terms checkbox in Comment form. This will be required field.
- Terms typolink parameter: Set the Terms page for above checkbox.
- Add Sitekey for Google reCAPTCHA v2: Set Google reCaptcha v2 sitekey. You can get it from here: https://www.google.com/recaptcha/admin/create
Here, you can set your own CSS & JS for this extension.
Here you can set default setiings of Comments plugin. If any of the field in Comment plugin is not defined, value set here will be used.
Add Comment Plugin¶
You can add Comment plugin from Add element wizard
Now, set all the settings of Comment plugin
Custom Date Format: Check this checkbox to use custom date format to display in Comment list.
Date Format: You can use any of the standard date format as well.
Time Format: You can use any of the standard time format as well.
Captcha Settings: You can set whether to display Captcha or not. You can select one of the options from below:
- None: Disable Captcha
- Image Captcha: Display Image Captcha. It will look like this:
Note: If you select Image Captcha, you should enable .htaccess file which is placed in Private folder of this extension.
- Google reCAPTCHA v2 : Display Google reCAPTCHA v2. Make sure to add Sitekey in Constant. It will look like this:
Add User Image: Add user image to display for all commments.
Display Comment Plugin on all pages of your site¶
You can display comment plugin on all pages of your website by adding below fluid object in your template file.
<f:cObject typoscriptObjectPath="lib.tx_nscomments.comments" />
That’s it, Now you can enjoy comments of your website visitors :)