getgrav / grav-skeleton-lingonberry-site

A clean, simple and responsive theme for bloggers. Features responsive design, retina ready assets, custom styling for all post formats, custom page templates and custom accent color.
https://getgrav.org
GNU General Public License v2.0
8 stars 5 forks source link

Can't configure comments in blog entries #2

Open maxalmonte14 opened 7 years ago

maxalmonte14 commented 7 years ago

I have the following settings in my user/config/plugins/comments.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
#          recaptcha_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:
#        - captcha:
#            recaptcha_secret: ej32oiej23oiej32oijeoi32jeio32je
        - email:
            subject: PLUGIN_COMMENTS.EMAIL_NEW_COMMENT_SUBJECT
            body: "{% include 'forms/data.html.twig' %}"
        - addComment:
        - message: PLUGIN_COMMENTS.THANK_YOU_MESSAGE
        - reset: true

That's the default setting but the enabled: true must be enough for work properly, anyway it's not working for me.

codiflow commented 5 years ago

This is caused because the first if ({% if grav.twig.enable %}) in the file htdocs/user/themes/lingonberry/templates/partials/comments.html.twig returns false.

Still searching for the why. Commenting it out activates the comment plugin as it should.

EDIT: Found the solution here: https://github.com/Peekmo/grav-theme-lingonberry/commit/20a8f8dc8e6509cacb67c745b9bc91f9e4915ffe