grav-plugin-comments/comments.yaml

78 lines
1.9 KiB
YAML

enabled: true
enable_on_routes:
- '/blog'
disable_on_routes:
- /blog/blog-post-to-ignore
- /ignore-this-route
#- '/blog/daring-fireball-link'
form:
name: comments
fields:
- name: name
label: PLUGIN_COMMENTS.NAME_LABEL
placeholder: PLUGIN_COMMENTS.NAME_PLACEHOLDER
autocomplete: on
type: text
validate:
required: true
- name: email
label: PLUGIN_COMMENTS.EMAIL_LABEL
placeholder: PLUGIN_COMMENTS.EMAIL_PLACEHOLDER
type: email
validate:
required: true
- name: text
label: PLUGIN_COMMENTS.MESSAGE_LABEL
placeholder: PLUGIN_COMMENTS.MESSAGE_PLACEHOLDER
type: textarea
validate:
required: true
- name: date
type: hidden
process:
fillWithCurrentDateTime: true
- name: title
type: hidden
evaluateDefault: grav.page.header.title
- name: lang
type: hidden
evaluateDefault: grav.language.getLanguage
- name: path
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
buttons:
- type: submit
value: PLUGIN_COMMENTS.SUBMIT_COMMENT_BUTTON_TEXT
process:
- email:
subject: PLUGIN_COMMENTS.EMAIL_NEW_COMMENT_SUBJECT
body: "{% include 'forms/data.html.twig' %}"
# - captcha:
# recatpcha_secret: ej32oiej23oiej32oijeoi32jeio32je
- addComment:
- message: PLUGIN_COMMENTS.THANK_YOU_MESSAGE
- reset: true