Bolt extension to add a simple local comment system
- Comment form twig function
- Comments list twig function
- Comments number twig function
- Config personal templates
- Comment with or without approval
- Use gravatar if possible
- Use CSS Emoticons
- Use Honeypot technique for spam
- Notifications are sent to followers of a thread
- Add mention system with Tribute.js
- Bolt 3.x installation
- [optional] Send email for new content to to send email to administrator when new comment is published
- Comment Entity have to be create manually on contentypes.yml
- Translates only load after Bolt 3.1.X
- Add Notification to website owner for approval
- Enhance Spam detection : add reCaptcha or list personal questions/responses or Akismet
- Manage IP Blacklist ?
- Login to your Bolt installation
- Go to "View/Install Extensions" (Hover over "Extras" menu item)
- Type
bolt-simple-comment-system
into the input field - Click on the extension name
- Click on "Browse Versions"
- Click on "Install This Version" on the latest stable version
- You have to add
comment
ContentType. Connect to your admin, got to "Configuration/Contenttypes" and add the following :
comments:
name: Comments
singular_name: Comment
fields:
slug:
type: slug
author_display_name:
type: text
label: Display Name
author_email:
type: text
label: Email
body:
type: html
height: 300px
guid:
type: text
label: Parent entity
notify:
type: checkbox
label: Keep author notify of new comments
recordsperpage: 100
show_on_dashboard: true
viewless: true
sort: -datepublish
icon_many: "fa:comments"
icon_one: "fa:comment"
- Then, you have update your database, got to "Configuration/Check database" and click on "Update the database" button.
Note:
- This extension may uses the Swiftmailer library to send email notifications, based on the
mailoptions:
setting in your Boltapp/config/config.yml
file. - When first installed, Extension defaults to turning debugging on in the configuration. This should be turned off when deployed in production. When debugging is on, all outbound emails are sent to the configured debug email address.
- When you install Extension, you may have to create
app/config/extensions/boltsimplecommentsystem.leskis.yml
.
Tip: If you want to modify the HTML templates, you should copy the .yml
file to your theme/
folder, and modify it there. Any changes in the file in the distribution might be overwritten after an update to the extension. For instance, if you copy bscs_list_comments.twig
to theme/base-2016/my_list_comments.twig
, the corresponding line in config.yml
should be: list: my_list_comments.twig
features:
comments:
order: asc # 'desc' if you want the new comments at the top
# default_approve: true # 'false' if submited comments should get "draft" status by default
questions:
enabled: false
# list:
# - question: What is the color of the blue sky?
# responses: blue
# - question: What is the sum of two plus one?
# responses: [ three, 3 ]
gravatar:
enabled: true
# url: https://www.gravatar.com/avatar/XXX?s=40&d=mm
emoticons:
enabled: true
animate: false
mention:
enabled: true
notify:
enabled: true
debug:
enabled: true
address: noreply@example.com # email used to send debug notifications
email:
from_name: Your website
from_email: your-email@your-website.com
# replyto_name: #
# replyto_email: #
# templates:
# form: extensions/leskis/bolt-simple-comment-system/templates/bscs_form_comment.twig
# list: extensions/leskis/bolt-simple-comment-system/templates/bscs_list_comments.twig
# emailbody: extensions/leskis/bolt-simple-comment-system/templates/bscs_email_body.twig
# emailsubject: extensions/leskis/bolt-simple-comment-system/templates/bscs_email_subject.twig
# assets:
# frontend:
# load_js: true
# load_css: true
Where you want to display the comment list, add on your record template:
{# Define a uniq id for this list of comments #}
{% set guid = record.contenttype.singular_slug ~ '/' ~ record.id %}
{# display the list of comments for this uniq id #}
{{ bscs_list_comments({ 'guid': guid }) }}
{# display comment form for this uniq id #}
{{ bscs_add_comment({ 'guid': guid }) }}
{# display number of comments for this uniq id #}
{% set numberOfComments = bscs_count_comments({ 'guid': guid }) %}
{% if numberOfComments == 0 %}
No comment.
{% else %}
There are {{ numberOfComments }} comment{{ numberOfComments > 1 ? 's' }}{% endif %}
This Bolt extension is open-sourced software licensed under the MIT license