Forum
Comments App not working
Hi,
I'm using the latest version of Perch and trying to get Comments to work. The installation instructions seem deprecated because they just don't work!
Firstly when I dropped the app into the add ons folder (perch/addons/apps/perch_comments) and amended the apps.php file to include 'comments' or 'perch_comments' the page loads an error:
include(/Users/louisotto/Code/EARLY ACCESS/perch/addons/apps/comments/runtime.php): failed to open stream: No such file or directory in /Users/louisotto/Code/EARLY ACCESS/perch/core/inc/apps.php
Then I went into the file and added the following lines:
case 'comments': include(PERCH_PATH.'/addons/apps/perch_comments/runtime.php'); break;
When I reloaded the page the comment form appears, and allows me to submit but every time I do it doesn't actually send a comment anywhere, and doesn't update the backend. At this point I'm lost, can you help?
I need to see your Diagnostics Report to help (you should have been asked for that when creating the thread).
Sorry Rachel, please see below:
You need to update your
apps.php
to:Thanks Drew, I've done that now, but it doesn't seem to have changed anything. Frontside validation on email addresses work, but when I submit the form the page refreshes and the content remains in the form. The comments app section in the admin panel hasn't changed either, it hasn't registered the comments section.
Really puzzled by this, not sure how to proceed!
If you add debug to the page, what does it output after submitting your form?
Hi Drew,
OK, I noticed in the debug this line:
Array ( [commentURL] => format )
I was simply entering 'test' in the website form, and it was blocking that. Actually, there is no front-end validation message. With a bad email it informs you, but with a bad website url it doesn't say anything at all. Might be worth looking in to.Also, it said your comment will appear after moderation, but no moderation was needed. It appeared straight away, so the default setting may need to change as well.
Thanks for yours and Rachel's assistance on this :)
Ok - what do you have in your template for this? Should be something like
If you're logged into Perch then the moderation step is skipped. It's boring to moderate your own comments.
Haha absolutely! Yeah I tried in another browser and it worked perfectly, sorry about that!
Just a quick question, if I was going to put a comments section below lots of pages as part of an article creation, how would you best implement it? I'm doing a video games review site, so at the bottom of each video game review there will be comments. I can't think of a good way to get the comments into each page other than put it into the article template at the bottom, but then I run into the issue of creating a unique name for each one.
Is there an easy way to access page variables that are set through the Perch CMS? Or is there a better way you could suggest?
Do your articles have a unique identifier already? Something like an article slug, perhaps. I'd use that.
We don't use slugs no, as each review sits on its own page, essentially: root/reviews/{game-name}
I can't obviously paste php code into a text box in the back end as it comments it out, but is there a way of circumventing this maybe through a whitelist or pattern match? It's a hack fix, but may work?
Can you give an example of what you're trying to do? I'm not sure where the problem lies.
Basically each game review sits on its own page. I have my pages/default.php set up for the game review, and it pulls in a template that contains all of the review content. Each page should have a comments section below the review itself. My issue is how to tie the comments section to the game when I'm using templates rather than just having them all as static pages.
Supposing I was to use a slug on each page even as a reference, how could I tie it's value to the comments? It can't be as easy as perch_comments("slug"); right?
In that case the page URL would serve as a unique identifier, wouldn't it?
My lord why didn't I consider that!? Thank you for your patience Drew!! I really appreciate it :)