Jump to content
paulb

Setting up the comment section.

Recommended Posts

Hello,

I recently started making a blog using Processwire and since i'm completely new, I struggle with a few things.
I'm trying to make a comment section in my blog post, so I followed the tutorial and pasted the two code lines in my template.

18		echo $page->comments->render(); 
19	 	echo $page->comments->renderForm(); 

 

but now I have this error on my page :

Error: Call to a member function render() on null (line 18 of C:\wamp64\www\processwire\site\assets\cache\FileCompiler\site\templates\Post.php) 

 

Am I missing something?

Thanks for your help.

Share this post


Link to post
Share on other sites

Hi and welcome to the forum @paulb.

 

To me, it look like you forgot to add the field to your template (I don't see this step in the tutorial).

In the admin, go to Setup > Templates > your_template, add the field comments to it then save.

 

comments.thumb.png.abe8a954da753fa1407c156a10531c6e.png

 

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites

Hey!

Thanks for your fast reply.
It seems like everything is alright with my comment field,

I just wrote "Comments" instead of "comments" and completely forgot it was case sensitive.

Thanks again!

  • Like 2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By NehaPillai
      Hello Everyone, I was trying to update SEO meta title, description and meta keywords for my website in Process Wire CMS but it saving in the backend but it is not reflecting on my website, Please help me regarding this error. Please find below attached screen shot for your ref. TIA.


    • By Rhen GWL
      I'm trying to install comments on two of my clients' websites. In both cases, I'm able to display the comment submission form, but the form submissions are not being saved or display. Once I click the submit button, I'm directed to the homepage where #CommentForm is appended to the end of the URL. I have looked through countless forums and Google searches, but I can't find any advice that has fixed this issue. I have followed the instructions from https://processwire.com/docs/modules/guides/comments/ exactly as described, and I'm getting no where.
      Like I said, this is set up on two different websites and I'm seeing the same issues with both. I assume it's some issue with connecting with a database, but I don't see anything in the instructions on PW's website that says I need to do anything there.
    • By eschoonen
      I'm working on the threaded comments on my website and for this I need to include the comments.js
      When I do this it keeps on giving me the "Uncaught ReferenceRrror: jQuery is not defined". Whatever I do it keeps giving me this error message.
      It's the last javascript file that I load in. So how do I fix it?
    • By cosmicsafari
      Hi all,
      I have been asked by a client whether we can setup load balancing for their existing Processwire site.
      From my investigations on Google and within these forums, it definitely seems possible but as a newbie with a basic understanding of the subject im a bit lost.
      Does anyone know of any existing tutorials for settings up load balancing with PW?
      What items would need to be changed on their current stand alone install, is there a list of best practices worth consulting etc?
      As I understand it we would need to have some sort of copying mechanism (rsync script most likely) in order to make sure any uploaded assets are shared between the main server and the fallback ones, other than that im not sure what else would need to be ammended.
      Any thoughts/help would be greatly appreciated.
    • By quickjeff
      Hi Guys,
      I am running a page template that contains a filter form that allows users to display results based on number of  comments. 
      Here is what I am thinking about doing: 
      -add new field called total_comments 
      -somehow populate this field every time a new comment is added or removed by admin with count($page->comments)
      -use form filter to display results that the selector form has found.
      Example: $selector = “total_comments>=$q”; 
       
      My question to everyone: Is this a good approach? If so how do I get another field to update based on the comment module adding or removing a comment? 
×
×
  • Create New...