Forum

Thread tagged as: Addons, Blog, Comments

Blog Comments

I'm confused about how to set up comments for a blog. Currently, I'm using the following on my 'post.php' page, but when I submit a comment from the form, I get nothing appearing in the Comments dashboard or the blog dashboard, and there is no success message when I submit a form. Just... nothing. Can anyone give me a quick tutorial on how to set up comments for individual posts please?

Thanks very much!

Paul Moignard

Paul Moignard 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Do you have any redirects configured that might be interfering with the POST?

Nope. No redirects. Here's my code:

<div class="col-threequarters right"> <?php perch_blog_post(perch_get('s')); ?>
<div class="comments"> <?php perch_blog_post_comment_form(perch_get('s')); ?> <?php perch_blog_post_comments(perch_get('s'), array( 'count' => 10, )); ?> </div><!-- End col-threequarters -->

Thanks in advance for your help Drew!

Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you turn on debug for the page and let me know what it outputs after clicking the submit button?

Sure.

DIAGNOSTICS: SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/blog/post.php' OR regionPage='' ORDER BY regionPage DESC Fetching from cache: perch_blog_categories39c32dbc0dc0c597cc310708cbfab488 SELECT *, categoryID AS _id, categoryPostCount as qty FROM perch2_blog_categories WHERE categoryPostCount>0 ORDER BY categoryTitle ASC SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0 Using template: /templates/blog/category_link.html Caching: perch_blog_categories39c32dbc0dc0c597cc310708cbfab488 SELECT p. FROM perch2_blog_posts p WHERE postStatus='Published' AND postDateTime<='2014-10-02 11:22:00' AND postSlug='2014-09-24-test-4' Using template: /templates/blog/post.html SELECT * FROM perch2_blog_sections ORDER BY sectionTitle ASC SELECT * FROM perch2_blog_posts WHERE postStatus='Published' AND postDateTime<='2014-10-02 11:22:00' AND postSlug= '2014-09-24-test-4' SELECT categoryID FROM perch2_blog_posts_to_categories WHERE postID = '6' SELECT * FROM perch2_blog_posts WHERE postID='6' AND postStatus='Published' AND postDateTime<='2014-10-02 11:22:00' SELECT categoryID FROM perch2_blog_posts_to_categories WHERE postID = '6' Using template: /templates/blog/comment_form.html SELECT * FROM perch2_blog_comments WHERE 1=1 AND postID='6' AND commentStatus='LIVE' ORDER BY commentDateTime ASC Using template: /templates/blog/comment.html

Oops. Forgot to submit. Here's what it says after I submit:

DIAGNOSTICS:
SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
Array

(

    [commentURL] => format

)


SELECT regionKey, regionHTML FROM perch2_content_regions 
WHERE regionPage='/blog/post.php' OR regionPage='*' ORDER BY regionPage DESC
Fetching from cache: perch_blog_categories39c32dbc0dc0c597cc310708cbfab488
SELECT p.* FROM perch2_blog_posts p WHERE postStatus='Published' AND postDateTime<='2014-10-02 11:24:00' AND postSlug='2014-09-24-test-4'
Using template: /templates/blog/post.html
SELECT * 
FROM perch2_blog_sections ORDER BY sectionTitle ASC
SELECT * FROM perch2_blog_posts WHERE postStatus='Published' AND postDateTime<='2014-10-02 11:24:00' AND postSlug= '2014-09-24-test-4'
SELECT categoryID FROM perch2_blog_posts_to_categories WHERE postID = '6'
SELECT * FROM perch2_blog_posts WHERE postID='6' AND postStatus='Published' AND postDateTime<='2014-10-02 11:24:00' 
SELECT categoryID FROM perch2_blog_posts_to_categories WHERE postID = '6'
Using template: /templates/blog/comment_form.html
SELECT * FROM perch2_blog_comments WHERE 1=1 AND postID='6' AND commentStatus='LIVE' ORDER BY commentDateTime ASC
Using template: /templates/blog/comment.html
Drew McLellan

Drew McLellan 2638 points
Perch Support

It looks like a validation error is being thrown over the format of the URL field.

Do you have an error message associated with that field for format errors?

I don't think so. I haven't modified any of the stock templates yet. I was just trying to get it working.

Drew McLellan

Drew McLellan 2638 points
Perch Support

That's odd. What value are you entering for the URL field?

Just a basic url:

www.starling.com

Drew McLellan

Drew McLellan 2638 points
Perch Support

I think the HTML5 spec requires a URL with the protocol:

https://www.starling.com

Hmmmmm. Ok. I'll give that a try.

Yep. That did it. Problem solved. Thanks Drew. I'll have to make sure that there is an error if people don't add "https://" as part of their URLs.