Skip to content

Commit

Permalink
Improve plugin readme. Uncomment config options for captcha and email
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviocopes committed Oct 16, 2015
1 parent 7d7dbd1 commit 85bb5c2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Or clone from GitHub and put in the `user/plugins/comments` folder.

# Usage

Edit the

Add `{% include 'partials/comments.html.twig' with {'page': page} %}` to the template file where you want to add comments.

For example, in Antimatter, in `templates/item.html.twig`:
Expand Down Expand Up @@ -43,7 +45,9 @@ For example, in Antimatter, in `templates/item.html.twig`:
{% endembed %}
```

The comment form will appear to the blog post items.
The comment form will appear on the blog post items matching the enabled routes.

To set the enabled routes, create a `user/config/plugins/comments.yaml` file, copy in it the contents of `user/plugins/comments/comments.yaml` and edit the `enable_on_routes` and `disable_on_routes` options according to your needs.

# Enabling Recaptcha

Expand All @@ -61,13 +65,11 @@ Further improvements to the comments visualization will be added in the next rel

# Email notifications

The plugin interacts with the Email plugin to send emails upon receiving a comment.
The plugin interacts with the Email plugin to send emails upon receiving a comment. Configure the Email plugin correctly, setting its "Email from" and "Email to" email addresses.

# Things still missing

- Add language file
- Allow to delete comments from the Admin Plugin
- Allow some pages to disable adding comments
- Ability to see all comments of a page in the Admin Plugin
- Ability to reply to a comment from the Admin Plugin
- Auto-fill the comment form when a user is logged in
28 changes: 14 additions & 14 deletions comments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,26 @@ form:
type: hidden
evaluateDefault: grav.uri.path

# - name: g-recaptcha-response
# label: Captcha
# type: captcha
# recatpcha_site_key: e32iojeoi32jeoi32jeoij32oiej32oiej3
# recaptcha_not_validated: 'Captcha not valid!'
# validate:
# required: true
# process:
# ignore: true
- name: g-recaptcha-response
label: Captcha
type: captcha
recatpcha_site_key: e32iojeoi32jeoi32jeoij32oiej32oiej3
recaptcha_not_validated: 'Captcha not valid!'
validate:
required: true
process:
ignore: true

buttons:
- type: submit
value: Submit

process:
# - email:
# subject: "[Site Guestbook] {{ form.value.name|e }}"
# body: "{% include 'forms/data.html.twig' %}"
# - captcha:
# recatpcha_secret: ej32oiej23oiej32oijeoi32jeio32je
- email:
subject: "[New Comment] from {{ form.value.name|e }}"
body: "{% include 'forms/data.html.twig' %}"
- captcha:
recatpcha_secret: ej32oiej23oiej32oijeoi32jeio32je
- addComment:
- message: Thank you for writing your comment!

Expand Down

0 comments on commit 85bb5c2

Please sign in to comment.