Giter Site home page Giter Site logo

grav-plugin-comments's Introduction

Grav Comments Plugin

The Comments Plugin for Grav adds the ability to add comments to pages, and moderate them.

Installation

The Comments plugin is easy to install with GPM.

$ bin/gpm install comments

Or clone from GitHub and put in the user/plugins/comments folder.

Usage

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:

{% embed 'partials/base.html.twig' %}

    {% block content %}
        {% if config.plugins.breadcrumbs.enabled %}
            {% include 'partials/breadcrumbs.html.twig' %}
        {% endif %}

        <div class="blog-content-item grid pure-g-r">
            <div id="item" class="block pure-u-2-3">
                {% include 'partials/blog_item.html.twig' with {'blog':page.parent, 'truncate':false} %}
            </div>
            <div id="sidebar" class="block size-1-3 pure-u-1-3">
                {% include 'partials/sidebar.html.twig' with {'blog':page.parent} %}
            </div>
        </div>

        {% include 'partials/comments.html.twig' with {'page': page} %}
    {% endblock %}

{% endembed %}

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.

Make sure you configured the "Email from" and "Email to" email addresses in the Email plugin with your email address!

Enabling Recaptcha

The plugin comes with Recaptcha integration. To make it work, create a user/config/plugins/comments.yaml file, copy in it the contents of user/plugins/comments/comments.yaml and uncomment the captcha form field and the captcha validation process. Make sure you add your own Recaptcha site and secret keys too.

Where are the comments stored?

In the user/data/comments folder. They're organized by page route, so every page with a comment has a corresponding file. This enables a quick load of all the page comments.

Visualize comments

When the plugin is installed and enabled, the Comments menu will appear in the Admin Plugin. From there you can see all the comments made in the last 7 days.

Further improvements to the comments visualization will be added in the next releases.

Email notifications

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

  • Allow to delete comments from the Admin Plugin
  • 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

grav-plugin-comments's People

Contributors

bovisp avatar christianhanne avatar diazwatson avatar flaviocopes avatar geraldhansen avatar gitname avatar hexplor avatar janklostermann avatar johnmica avatar kek91 avatar khanduras avatar kinformation avatar lufog avatar metbril avatar rhukster avatar rsip22 avatar tidiview avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

grav-plugin-comments's Issues

Error after install plugin

UnexpectedValueException thrown with message "RecursiveDirectoryIterator::__construct(D:/OpenServer/domains/graw/user/data/comments,D:/OpenServer/domains/graw/user/data/comments): "

Stacktrace:
#10 UnexpectedValueException in D:\OpenServer\domains\graw\user\plugins\comments\comments.php:207
#9 RecursiveDirectoryIterator:__construct in D:\OpenServer\domains\graw\user\plugins\comments\comments.php:207
#8 Grav\Plugin\CommentsPlugin:getFilesOrderedByModifiedDate in D:\OpenServer\domains\graw\user\plugins\comments\comments.php:250
#7 Grav\Plugin\CommentsPlugin:getLastComments in D:\OpenServer\domains\graw\user\plugins\comments\comments.php:126
#6 Grav\Plugin\CommentsPlugin:onPluginsInitialized in <#unknown>:0
#5 call_user_func in D:\OpenServer\domains\graw\vendor\symfony\event-dispatcher\EventDispatcher.php:164
#4 Symfony\Component\EventDispatcher\EventDispatcher:doDispatch in D:\OpenServer\domains\graw\vendor\symfony\event-dispatcher\EventDispatcher.php:53
#3 Symfony\Component\EventDispatcher\EventDispatcher:dispatch in D:\OpenServer\domains\graw\vendor\rockettheme\toolbox\Event\src\EventDispatcher.php:23
#2 RocketTheme\Toolbox\Event\EventDispatcher:dispatch in D:\OpenServer\domains\graw\system\src\Grav\Common\Grav.php:377
#1 Grav\Common\Grav:fireEvent in D:\OpenServer\domains\graw\system\src\Grav\Common\Grav.php:208
#0 Grav\Common\Grav:process in D:\OpenServer\domains\graw\index.php:37

Comments v1.0.0

Email subject

The subject line does not display wildcard text, but "PLUGIN_COMMENTS.EMAIL_NEW_COMMENT_SUBJECT"

Cannot get comments to reliably save to the data folder

I am having trouble getting the comments module to work reliably. Site is hosted on Wirenine (Apache, PHP 7.0) . I have cache_enable: false configured in the page header. I adjusted the process order to post before sending mail and I have tried it default too. It works sporadically. It does send mail, but not every time either. Last time I tried to get it working, it would work after I did a clear-cache for the the site, but only once. This time I cannot get it to post at all.

Here is my config file:

enabled: true

enable_on_routes:
  - '/wallpapers'

disable_on_routes:
  - /blog/blog-post-to-ignore
  - /ignore-this-route
  #- '/blog/daring-fireball-link'

form:
    name: comments
    fields:
        - name: name
          label: Name
          placeholder: PLUGIN_COMMENTS.NAME_PLACEHOLDER
          classes: form-control
          autocomplete: on
          type: text
          validate:
            required: true

        - name: email
          label: Email
          placeholder: PLUGIN_COMMENTS.EMAIL_PLACEHOLDER
          classes: form-control
          type: email
          validate:
            required: true

        - name: text
          label: Comment
          placeholder: PLUGIN_COMMENTS.MESSAGE_PLACEHOLDER
          type: textarea
          classes: form-control
          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


    buttons:
        - type: submit
          value: PLUGIN_COMMENTS.SUBMIT_COMMENT_BUTTON_TEXT
          classes: 'btn btn-md btn-black'

    process:
        - addComment:
        - message: PLUGIN_COMMENTS.THANK_YOU_MESSAGE    
        - email:
            subject: PLUGIN_COMMENTS.EMAIL_NEW_COMMENT_SUBJECT
            body: "{% include 'forms/data.html.twig' %}"
        - reset: true

Delete comments from Admin

I know this is in the pipeline, and would just like to add my support for this as a much-needed enhancement.

Undefined property: Grav\Common\Grav::$user on Grav v1.1.1

Thanks for your work so far.

I just tried to install the plugin on Grav v1.1.1, PHP 5.5.26

No matter where I add the include line of the twig-template I always get the following error.
0 - An exception has been thrown during the rendering of a template ("Undefined property: Grav\Common\Grav::$user") in "partials/comments.html.twig" at line 14.

Seems like the problem was introduced in commit ee60853. If I remove the check in this commit, the problem is gone (also the feature you introduced in this commit no longer works).

Differentiate authenticated comments

If I'm not mistaken, I see that the plugin already checks if a commenter is logged in through the Login plugin and replaces their name and e-mail with those of their account if a match is found:

                if (isset($this->grav['user'])) {
                    $user = $this->grav['user'];
                    if ($user->authenticated) {
                        $name = $user->fullname;
                        $email = $user->email;
                    }
                }

However there is no check in place to verify that a comment was posted by a logged in user, and notably by the admin, so any guest can post with the same name and e-mail with the same result. Would it be difficult to add such a parameter to each comment in a format like {{comment.author.level}} (guest/.../admin) so one could differentiate them in the output? This would let me avoid commenters usurping other people's names by using specific CSS and markings on authenticated comments and allow me to integrate an avatar system into it.

Is there something like $this->grav['userlevel'] that I can simply plug into onFormProcessed() where it will be picked up seamlessly by the rest of the system?

Can't translate Comment form label and placeholders

Hi!

How does one translate the frontmatter defined in /users/plugins/comments/comments.yaml? The translations as defined in /users/plugins/comments/languages.yaml show up just fine:

alt

and I guess I could also translate the submit button text in my languages theme file. The form labels and placeholders as defined in /users/plugins/comments/comments.yaml, as far as I can see, cannot be translated.

Is there a way to do this?

Comments not being displayed

Hello!! i installed the plugin and it appears on my page. i mention that i still didn't fill the email plugin infos, is this the reason why when i click the " submit" the comments doesn"t go to data==>comments?

Problem with comments of more than 7 days

Hello,

When I have comments with a date more than 7 days ago the comments page in the admin plugin (at admin/comments) is broken.

I would like to precise that I'm trying to migrate an old site into grav that's why I'm entering the comments with an old date.
Could you help ?
Thanks

Undefined Index: lang (etc)

Found a bug. Fixed it.

I don't really know how to use github... so I'll write here and then try to suggest the edit.
Within comments.php line 192

the post variable grabbing lines should be updated from:

            $lang = filter_var(urldecode($post['lang']), FILTER_SANITIZE_STRING);
            $path = filter_var(urldecode($post['path']), FILTER_SANITIZE_STRING);
            $text = filter_var(urldecode($post['text']), FILTER_SANITIZE_STRING);
            $name = filter_var(urldecode($post['name']), FILTER_SANITIZE_STRING);
            $email = filter_var(urldecode($post['email']), FILTER_SANITIZE_STRING);
            $title = filter_var(urldecode($post['title']), FILTER_SANITIZE_STRING);

to

            $lang = filter_var(urldecode($_POST['lang']), FILTER_SANITIZE_STRING);
            $path = filter_var(urldecode($_POST['path']), FILTER_SANITIZE_STRING);
            $text = filter_var(urldecode($_POST['text']), FILTER_SANITIZE_STRING);
            $name = filter_var(urldecode($_POST['name']), FILTER_SANITIZE_STRING);
            $email = filter_var(urldecode($_POST['email']), FILTER_SANITIZE_STRING);
            $title = filter_var(urldecode($_POST['title']), FILTER_SANITIZE_STRING);

This was breaking the functionality of almost the whole plugin.

It does not work

I use this plugin in its 1.2.7 version with Grav 1.3.4. And it does not work (blank result).

Try 1.2.2 and the comment form appears, but no comments are added after submit.

Anyone can confirm me that does it works with the grav latest version?

'continue_link: false' frontmatter disables comment form

Hi,

I'm using continue_link: false in frontmatter for some of my blog posts (because the continue_link is always visible regardless of summary settings). This frontmatter disables the comment form.

I've worked around the issue by tweaking my blog_item.html.twig to include the comment partial after the {% if not truncate %} line.

I admit I haven't researched the issue much, because it's very late and I just noticed it, but I can provide more info/QA as needed.

to exclude email option from comments form

here's a working option for comments.yaml
this way the email form is not shown and an email address is not required

name: email
label: optional
placeholder: email
type: email
type: hidden
validate
  required: false

To do

Hello,

I created this issue in order to know what's next for this plugin?
It's a great plugin but we could add several features to make it even better:

  • Edit/delete comments from the admin plugin
  • See the comment in the admin plugins
  • Be able to answer to a comment with a notification system to let the comment's author know someone just posted an answer on his comment

In fact, something like the Wordress comment system + this plugin.

Thanks and keep up the good work!

Date of comments not respecting Grav settings

Hi,
In the Configuration - System of Grav, you can modify the short and long date format. However, it seems grav-plugin-comments does not use this function. (I put both with short date, but my comments are still using long date)

Any way to fix it?

Thank you

Languages - Brazilian Portuguese - pt-BR

Hi,
I had problems with the comments not being translated into Brazilian Portuguese. I found out that the code in the languages.yaml file is 'pt-br'. The usual language code for Brasilian Portuguese in all system is pt-BR. So, correcting that language code in the file gets translation working for this plugin too. I did in my website, and suggest it gets done in there too. I did not do it now because I have no access.

Problem processing posts

Hi

After a recent update I'm finding the comments plug-in is no longer working.

To remove misconfiguration issues within my theme I have downloaded the "Helium Site" theme (https://github.com/gantry/gantry5), added in the grav-plugin-comments plugin and updated its configuration file to be enabled on the '/pages/blog' route.

The plugin appears correctly, but when POSTing a comment to the blog post nothing appears to happen.

By adding a liberal smattering of trace statements through the code it appears the function onFormProcessed within grav-plugins-conmments is never getting called. The same appears to be true for the form plugin as well.

I have obviously got some major misconfigraton going on... but can't figure out what, especially as the only change I made to the "Helium Site" theme was to download the grav-plugin-comments plugin and update its comments.yaml to enable on the appropriate route.

Any ideas what I may be doing wrong?

Comments remain when their parent page is removed

When a page is deleted (from the admin panel or otherwise), its associated comments file remains in place. For most people that's probably not a problem visible in the front-end, but it creates some clutter. Not a big deal considering the likely size of the files involved. For me it's a bit more of a problem because I show the most recent comments in a sidebar, so they'll keep showing up even if their article is deleted or made invisible.

Would it be useful to have something in the plugin's admin page that checks for orphaned comments and offers to purge them? It could also offer to reroute comments for pages that have been moved or renamed.

TODOs

Here's a list of features that would help to make Comments plugin even better!

  • Cache comments for better performance (see stars) 60c8d09
  • Clear form on submission (shows previous comment currently) 0cf90a7
  • Support nonce + captcha type validation (captcha is already supported in the form building, see https://github.com/getgrav/grav-plugin-comments#enabling-recaptcha) - nonce is built-in as it uses the form plugin
  • Handle logged in users by not requiring username/email ee60853
  • Ability to edit/delete/moderate comments in admin
  • Open/Close form submission box .. closed on submission?
  • Support avatars/gravatars
  • Detect 'identical-repeat-messages' from same user
  • Support threaded comments
  • Support quoting/markdown
  • Nicer default formatting of comment output
  • regex support in the allowed routes
  • Ability to subscribe to all comments by id

routes strings or not?

In the comments.yaml section on routes, some of the values seem to be set as strings, others not.

enable_on_routes:
  - '/blog'

disable_on_routes:
  - /blog/blog-post-to-ignore
  - /ignore-this-route
  #- '/blog/daring-fireball-link'

Does it make any difference?

Race condition or caching problem

Hi,

I face a strange problem. I installed the plugin and grav (current developer versions) delivers different page content on reloads concerning the comment plugin. The comment block is missing. The rest of the page is ok.

I cleared all caches. I tried on two different host environments (nginx, apache with different php variants).

So I thought it might be connected to {% if grav.twig.enable %} in the template file. If I remove it I can see that the comment block is always printed on reloads, but now sometimes entered comments are instead missing from time to time.

It seems to be some sort of race condition.

Any advice what I might try?

Best regards,

Form v1.3.0-rc.4
Comments 1.1.4
Grav 1.1.0-rc.3

Comment is not saved. onFormProcessed is not called.

This is the first time I try Comments plugin. The form is shown but comment is not saved.
I have tried on both localhost and a live site (email is working) but the problem still exists.
I have uploaded the site at https://github.com/tranduyhung/grav-skeleton-blog-site, I really appreciate if you can take a look and let me know what I am doing wrong.

I have also tried to modify the form from

form:
    name: comments
    fields:

to

forms:
   comments:
      fields:

but still the same.

As I have debugged, onFormProcessed function is never called.

Thank you!

Mail sent not formatted properly

Hello,

When a comment is made the mail received is showing code not interpreted.

Mail object : PLUGIN_COMMENTS.EMAIL_NEW_COMMENT_SUBJECT

Mail body : 
<div>
<strong>PLUGIN_COMMENTS.NAME_LABEL</strong>:
name
</div>
<div>
<strong>PLUGIN_COMMENTS.EMAIL_LABEL</strong>:
[email protected]
</div>
<div>
<strong>PLUGIN_COMMENTS.MESSAGE_LABEL</strong>:
bla bla message
</div>
<div>
<strong></strong>:
</div>
<div>
<strong></strong>:
xxxx post title
</div>
<div>
<strong></strong>:
fr
</div>
<div>
<strong></strong>:
/blog/xxx-xxxxx-xxx
</div>

Do I have to do something in the config or is it a bug ?
Thank you in advance.

Comments appear on the wrong page.

I created a page template of item-comments for blog entries I want comments on.

I changed 4 pages from item to item-comment, Adding a comment on "page2" seems to work correctly, however that comment appears on the other pages instead of the correct comments. If I clear cache then all pages get the comments from "page1".

The data under user/data/comments/blog is correct so I believe this is purely a caching issue.

server error on ignored routes

hi! loving your plugin so far. having a problem with the routes - I copied contents of comments.yaml to my user/config/plugins folder and set an enabled route, and a disabled route. I added the include to my docs template.

when I go to my enabled route it works great! but when I go to any disabled route, either the exact route or its subroute, I get this:

Server Error
Sorry, something went terribly wrong!

400 - Template "partials/comments.html.twig" is not defined in "docs.html.twig" at line 23.

For further details please review your logs/ folder, or enable displaying of errors in your system configuration.

this is entered in logs:

[2016-05-27 16:18:50] grav.CRITICAL: Template "partials/comments.html.twig" is not defined in "docs.html.twig" at line 23. - Trace: #0 /var/www/html/system/src/Grav/Common/Grav.php(186): Grav\Common\Twig\Twig->processSite(NULL) #1 /var/www/html/vendor/pimple/pimple/src/Pimple/Container.php(113): Grav\Common\Grav::Grav\Common\{closure}(Object(Grav\Common\Grav)) #2 /var/www/html/system/src/Grav/Common/Grav.php(288): Pimple\Container->offsetGet('output') #3 /var/www/html/index.php(38): Grav\Common\Grav->process() #4 {main} [] []

what do you think?

recatpcha

At multiple places in the code and the config file "recatpcha" is used instead of "recaptcha".

While it might work, it feels wrong ;-).

comments plugin is interpreting the enable_on_routes variable differently now.

after the last grav update, comments have disappeared!
it seems the comments plugin is interpreting the enable_on_routes variable differently now.
i always had it as

enable_on_routes:
  - '/blog'

(this is still the default currently)

changing it to

enable_on_routes:
  - '/'

makes the comments re-appear.

my interpretation:
in my system.yaml, i'm telling grav to hide the ‘/blog’ route in urls.
it would seem that after the grav update, this is also internally applied to the twig environment?
am i correct?

also see here

Nothing gets rendered - grav.twig.enable appears obsolete

The sample comments.html.twig shows:
{% if grav.twig.enable %}

Which never is set even when twig is enabled in config/system.yaml

 33   process:
 34     markdown: true
 35     twig: true

I was able to make the comments come up by deleting the {% if grav.twig.enable %} and it's corresponding {% endif %}

Crickey!: "Call to a member function getTimestamp() on boolean"

Hello. I'm working on an migration script to import my posts and comments from Google Blogger to Grav. Everything working fine, the comments are also rendered normally on the live pages.

But when try to view the latest comments on "localhost/grav/admin/comments/", I get an error like this: "Call to a member function getTimestamp() on boolean".

screenshot-20181115_122145

The comment.yaml files are imported like this:

title: 'Xposed Installer APK Fix Android 4.4.4 by Solarwarez Application Download'
lang: false
comments:
  - {"text":"gan saya pake cyanogenMod 12.1 beta cocoknya pake xposed installer apa","date":"2016-03-30T03:31:10.200+07:00","author":"Hendry Wijayanto","email":"[email protected]","uri":"https://www.blogger.com/profile/16304488146178401806"}
  - {"text":"Hmm... Kalo gak salah ada xposed khusus buat Android Lollipop, cari aja di repo.xposed.info","date":"2016-03-30T11:41:36.355+07:00","author":"iday raD","email":"[email protected]","uri":"https://www.blogger.com/profile/13765705053643369839"}
  - {"text":"ok makasih gan.blognya bagus selalu update","date":"2016-03-31T02:12:50.493+07:00","author":"Hendry Wijayanto","email":"[email protected]","uri":"https://www.blogger.com/profile/16304488146178401806"}

Comments not working with Hydrogen theme (v5.4.1)

Hi.

I'm new and do not have any Grav experience. As theme I'm using Hydrogen v5.4.1. Unfortunately comments (v1.2.5) aren't working with this theme. When I switch to Antimatter, then comments are usable.

When I submit a comment, it will show an error message like:
Ups, es gibt da ein Problem. Eingabewerte bitte noch mal prüfen und das Formular erneut absenden.

German for: Houston, we have a problem.

Furthermore there is a strange line below the submit button:
<input type="hidden" id="form-nonce" name="form-nonce" value="c9563c67d98411fd8bdda80f5d4fac29" />

Is this fixable?

kind regards,
vitalitas

Comment works but gives error page

I am running grav v1.1.1 with comment plugin v1.2.1 (git commit c1fe1a6). The commenting works except when the user submits they get an error page that says "Class 'Grav\Plugin\Utils' not found"

In the top right box it shows /var/www/grav/grav-plugin-form/form.php with lines 123,124, 125 highlighted:

            case 'reset':
                if (Utils::isPositive($params)) {
                    $this->form->reset();

Reloading the page shows the comment, and I receive the notification email.

Comment section shows up twice

I successfully added the comment plugin and I can add comments to my page.

However, the comment section shows up twice:

  • under the blog item
  • at the end of the page

I'm using the antimatter theme and Grav 1.3.1

You can see what I mean here: http://whiskeybravo.art/a-good-old-friend

I used the original code from the plugin's readme file:

{% embed 'partials/base.html.twig' %}

    {% block content %}
        {% if config.plugins.breadcrumbs.enabled %}
            {% include 'partials/breadcrumbs.html.twig' %}
        {% endif %}

        <div class="blog-content-item grid pure-g-r">
            <div id="item" class="block pure-u-2-3">
                {% include 'partials/blog_item.html.twig' with {'blog':page.parent, 'truncate':false} %}
            </div>
            <div id="sidebar" class="block size-1-3 pure-u-1-3">
                {% include 'partials/sidebar.html.twig' with {'blog':page.parent} %}
            </div>
        </div>

        {% include 'partials/comments.html.twig' with {'page': page} %}
    {% endblock %}

{% endembed %}

Name field autofocus scrolling page

On the name input field, the autofocus attribute is set. I think this is why when my pages with the comments template load, they scroll to the bottom and focus the name input. Is this something that can be disabled, or is this intended behavior?

onFormProcessed not being called

I've installed the comments plugin, version 1.1.2, and followed the instructions to display the form on all blog pages. However, when I submit the form, it doesn't save any comments. As a sanity check, I added this to comments.php:

    public function onFormProcessed(Event $event)
    {
        $form = $event['form'];
        $action = $event['action'];
        $params = $event['params'];
        $grav['log']->info("here");   // Debug statement
        if (!$this->active) {
            return;
        }

The message does not show up in tail -f logs/grav.log. I have configured my permissions using the following script:

#!/bin/sh
chown www-data:www-data .
chown -R www-data:www-data *
find . -type f -not -name "fix-permissions.sh" | xargs chmod 664
find ./bin -type f | xargs chmod 775
find . -type d | xargs chmod 775
find . -type d | xargs chmod +s
umask 0002

Are there any tricks to figure out why onFormProcessed doesn't seem to be called? Is the debug statement a valid check?

Latest comments widget

I would like a latest comments widget that could be placed in the sidebar to pull from all articles/pages. I went and hacked something together based on the admin panel display, but it could use someone more knowledgeable bringing it in line with Grav's standards and generally making it less hacky.

Also, one missing feature is that I would like to link to each comment's post/page, and I don't know how to safely derive the URLs from the filePath.

I added this bit to function initializeFrontend() in comments.php (~line 130):

EDIT: SEE UPDATED CODE BELOW

I created a new function based on getLastComments(); essentially the same with irrelevant parts removed and a limit to the array size:

EDIT: SEE UPDATED CODE BELOW

Example output (you could also show the date):

EDIT: SEE UPDATED CODE BELOW

I hope posting it like this isn't too inconvenient. Any help would be appreciated!

No possibility to leave comments

I installed grav 1.0.0 RC6 and then the comments plugin. I took a look at the 'Usage' section on this github page and did what was described:

  1. Add the line to templates/item.html.twig
    item.html.twig.zip

  2. Copy comments.yaml from user/plugins/comments/ to user/config/plugins/

Since i have a blog page with a child post and the comments.yaml already mentioned - '/blog' under the 'enable_on_routes:' section, i did't change anything there - only removed every entry under disable_on_routes: because i want to show comments on every blog post.
comments.yaml.zip

But i still can't add comments to my example blog post. Here is the page structure so far:
pages

Can someone please point me in the right direction and show me what i did wrong?

please consider making a new plugin release

Version 1.0.1 as installed with ./bin/gpm is missing the nonce field in the template file:

 {{ nonce_field('form', 'form-nonce') }}

Which causes all submitted comments to receive the response "ops there was a problem, please check your input and submit the form again."

Workaround

The fixed template is already in the repository, its just not in a release. Users can fix the system by updating the local copy of the template at user/plugins/comments/templates/partials/comments.html.twig with the one from
https://github.com/getgrav/grav-plugin-comments/blob/develop/templates/partials/comments.html.twig or add the above nonce field just before the closing </form> tag

On creation of a comment always receive error

at qwyk.ly (using learn2 template) I always receive an error when I enter a comment:

Oops there was a problem, please check your input and submit the form again.

I am unable to find where this error is coming from - any help gratefully received

Feature request: turn off email notifications.

With every comment, an email gets sent. Can we have options to turn off emailing for specific routes, similar to enable_on_routes: and disable_on_routes:?

suggesting email_on_routes or no_email_on_routes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.