Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nothing gets rendered - grav.twig.enable appears obsolete #75

Open
mabushey opened this issue Nov 14, 2018 · 15 comments
Open

Nothing gets rendered - grav.twig.enable appears obsolete #75

mabushey opened this issue Nov 14, 2018 · 15 comments

Comments

@mabushey
Copy link

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 %}

@jeremycherfas
Copy link

I'm not actually seeing that statement, only {% if grav.twig.enable_comments_plugin %} and {% if grav.twig.comments|length %}.

My comments are not only not rendering, now, but all previous comments seem to have been deleted, so I am grasping at straws here.

@diagone3000
Copy link

diagone3000 commented Feb 14, 2019

I had {% if grav.twig.enable_comments_plugin %} too, in the file comments.html.twig

Replacing it by {% if comments.enabled %} seems to be correct (as seen in partial_item.html.twig in my current theme which is Bootstrap-blog).
With this change, HTML elements are now showing up.

I still have to find about the POST function not working, and eventually see if submitted comments are showing up then.

@Heraes-git
Copy link

@diagone3000 and @jeremycherfas : Any news ?
I've installed the plugin but it's broken : #78
Seems that the last 1.6 version of GRAV killed this plugin.

@sospcie
Copy link

sospcie commented Apr 16, 2019

in comments.html.twig replace

{% if grav.twig.enable %}

to this

{% if config.plugins.comments.enabled %}

The form will then show up.

However it still have some issues, like button name and the fact that it does not save the comments

@Heraes-git
Copy link

@sospcie What line is it ? I don't find it. Probably because I already modified the plugin's partial.
It think it's the first line, isn't it ? I had changed it to :

{% if config.plugins.comments %}

But still, the plugin makes my pages to throw en error (Crikey, as I said in #78).

@sospcie
Copy link

sospcie commented Apr 25, 2019

@Romarain Yes, that was the line. However, since my post I have done some test, with the default template, and the comment plugin seems to work. So need to do some more debugging why with other templates there is an issue. I did the test using latest GRAV 1.6.8

@Heraes-git
Copy link

@sospcie Hi. I'm actually trying to make that plugin to work, and can't.
I've tested, in a root page called "Test", to include the comments template :

	{% include "partials/comments.html.twig" %}

and it shows the form. But no matter I send the message, it isn't saved. I've looked into the /data folder, nothing is there.

@Kalmera74
Copy link

Kalmera74 commented Sep 12, 2019

To make the comments POST, "grav."part should be removed from the pages upper section eg. grav.config.plugins.comments.form.action => config.plugins.comments.form.action, and so on

@sospcie Hi. I'm actually trying to make that plugin to work, and can't.
I've tested, in a root page called "Test", to include the comments template :

	{% include "partials/comments.html.twig" %}

and it shows the form. But no matter I send the message, it isn't saved. I've looked into the /data folder, nothing is there.

@Heraes-git
Copy link

@Kalmera74 Unfortunately, this doesn't change anything. I've replace all the occurences in my custom /partials/comments.html.twig, and also in the custom comments.yaml, but it still doesn't work. Do we need to edit the PHP file too ?

@Kalmera74
Copy link

@Romarain There should be no need to edit the php file only editing the twig file sould have been enough. It is possible that your theme is also the part of the problem, but I am not sure.

@Heraes-git
Copy link

Heraes-git commented Sep 16, 2019

@Kalmera74 Do you use the enable_on_routes: option in the YAML of the plugin ?
When I don't use it, the form does appear (but nothing works as I said), but when I activate it for a route, it results in a Crikey : #78

@replayshot
Copy link

replayshot commented Oct 30, 2019

I had an issue with the comment code not showing up on the item page. After I did the below, it showed up.

in comments.html.twig replace

{% if grav.twig.enable %}

to this

{% if config.plugins.comments.enabled %}

The form will then show up.

However it still have some issues, like button name and the fact that it does not save the comments

but then when I entered and submitted a comment no comment appeared in Admin, nothing in data/comments.

I then tried the below (removing grav. from everywhere in the twig file) and that also did not solve anything.

To make the comments POST, "grav."part should be removed from the pages upper section eg. grav.config.plugins.comments.form.action => config.plugins.comments.form.action, and so on

Then I commented out the enable_on_routes: - also no comments posted

I've added email from/to to Email plugin. (however, I would think this would only have anything to do with the email and not with storing the comment).

Any other ideas? I am on localhost with the default Quark theme.

UPDATE: it does look like it has something to do with the email not functioning. If I disabled Email plugin, all works as expected.

@Heraes-git
Copy link

Heraes-git commented Nov 6, 2019

@replayshot

If I disabled Email plugin, all works as expected.

I tested by just removing the form - email: field from the YAML, but it still probably try something with the email plugin in the PHP. Interesting to know that disabling the email plugin improve things.

@failuretolaunch
Copy link

I'm struggling with this problem now. Tried all of the above, even removing the email field and disabling the email plugin but it's still not working - the form displays, but submitting a comment doesn't seem to do anything.

@rhukster
Copy link
Member

Granted, this was written before we had a lot of helper functions, but it does work even in latest Grav 1.7 with:

{% if grav.twig.enable_comments_plugin %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants