Gentics Mesh Comment Plugin

Gentics Mesh Comment Plugin

Description

All the content on your website is great, but it’s even greater if you allow visitors to interact. That’s why we built the Comment Plugin to increase the engagement!

The plugin provides the API that allows users (logged-in and optionally also anonymous ones) to leave comments to your content.

Of course the plugin can be configured to require moderation of either all or only anonymous comments. When enabled, the moderator(s) will be notified via email when new comments are waiting for approval. The text of the email can be customized according to your needs.

Documentation

Setup

  • Create a folder called plugins in your mesh directory if it does not exist yet

  • Put the fat jar inside your plugins folder

  • Create the folders plugins/comment, plugins/comment/storage/templates

  • Create a file plugins/comment/config.yml. See the configuration section for more details

  • Create handlebars templates in your storage/templates folder

  • If you want the plugin to send mails, follow the steps in the mail template section

Configuration

Basics

All configuration fields can be set in the config.yml. Some fields can can be overridden by other means. Here is the fallback order:

  1. Referenced Field Config

  2. Comment Section Node

  3. Project Configuration

  4. Configuration

  5. Default values

These fields can be overridden per project: allowAnonymous, requiresApproval, moderatorEmails, requiredForAnonymous, commentRoot, nodeConfigField

These fields can be overridden per comment section and in the referenced node: allowAnonymous, moderatorEmails, requiresApproval, requiredForAnonymous

Fields

Key Type Description Default value

commentRoot

uuid or webroot path

Must point to a folder node. All nodes for the comment plugin will be stored under this node.

REQUIRED

projectNames

array of strings

Names of the projects for which this plugin is activated

REQUIRED

allowAnonymous

boolean

Allows anonymous users to create comments

true

requiresApproval

boolean

Created comments have to be approved by an admin to be shown in public

false

moderatorEmails

array of strings

Emails will be sent to these adresses. Leave empty to deactivate emails

[]

requiredForAnonymous

Array of email, author, subject

These fields are required when anonymous users create comments

["email", "author"]

projectConfig

object

See above for details

{}

cacheTemplate

boolean

Caches JS templates

true

nodeConfigField

string

See above for details

null

mailServerConfig

object

See below for example

{}

mailTemplateFolder

string

Path to the folder of mail templates

plugins/comment/mailTemplates/

mailSender

string

Sender of mails

Admin <admin@example.com>

mailSubjects

map

See example below

See section Mail templates

Example File

commentRoot: "/comments"
projectNames:
  - cmsdemo
requiredForAnonymous: [
  "email", "author", "subject"
]
allowAnonymous: true
# Remove the following line for production. Default value is true
cacheTemplates: false
requiresApproval: true
nodeConfigField: commentConfig
moderatorEmails:
  - moderator@example.com
mailTemplateFolder: plugins/comment/mailTemplates
mailServerConfig:
  hostname: smtp.example.com
  port: 25
  starttls: REQUIRED
  login: NONE
  authMethods: null
  username: null
  password: null
  ssl: false
  trustAll: false
  keyStore: null
  keyStorePassword: null
  ownHostname: null
  maxPoolSize: 10
  keepAlive: true
  allowRcptErrors: false
mailSubjects:
  commentCreated: "A test comment has been created"
mailSender: CMS Admin <cms@example.com>

Mail Templates

If you want the plugin to send mails, you have to provide mail templates as handlebar files. You can configure the folder of your templates in the configuration file. You must provide all template files or else sending mails will fail.

Available Templates

Event Filename Description Default subject Available context variables

Comment created

commentCreated.hbs

Sent whenever a comment is created

A comment has been created

comment, reference

Context Variables

Name Description Type

comment

Related comment

Mesh node response

reference

Referenced node of the comment section

Mesh node response

Plugin Details

The plugin includes developer documentation, but does not provide a management user interface.

Interested?

Version

1.7.2

License

commercial

Authors

Gentics