Author: Anton Filatov.
This Bolt extension can be used as comment system.
composer require positron48/bolt-simple-comments
php bin/console doctrine:migrations:migrate
php bin/console cache:clear --no-warmup
Command cache:clear
needs to refresh admin pages list.
If you want to use Google recaptcha enterprise - get the api key via this guide and next steps:
- go to https://console.cloud.google.com/apis/credentials and create new service account;
- select to your service account role
reCaptcha Enterprise Agent
; - go to service account and create new JSON key;
- store credentials in /config/extensions/service-account-recaptcha-credentials.json
or change variable
GOOGLE_APPLICATION_RECAPTHA_CREDENTIALS
in your .env file. Default value is../config/extensions/service-account-recaptcha-credentials.json
.
Add to .env file some parameters:
RECAPTCHA_KEY=
GOOGLE_API_KEY=
GOOGLE_PROJECT_ID=
GOOGLE_APPLICATION_RECAPTHA_CREDENTIALS=../config/extensions/service-account-recaptcha-credentials.json
RECAPTCHA_KEY
- Key Id of your recaptcha enterprise key.
GOOGLE_API_KEY
- Api key from section 'API Keys' in Credentials page.
GOOGLE_PROJECT_ID
- Project Id of your project in Google Cloud Platform.
GOOGLE_APPLICATION_RECAPTHA_CREDENTIALS
- path to your json file with credentials.
After installation in your admin panel /bolt you will see a new menu item called "Comments". There are all comments with edit ability.
To show comment list on contentpage use twig function commentList
with content as first param:
{{ commentList(content) }}
Also you can override default template by creating file comment_list.html.twig
in your theme folder.