Jump to content
Ralf

Theme Regular - Disable Comments

Recommended Posts

Dear processwire professionals,

i have a question about the PW standard template "Regular". This template is great and I use it to create a new page with UIKit. 

But at the moment I still fail something due to a task... Is it possible to design the comment function for the blog part OPTIONAL? Which part of the code do I have to change if I don't want to allow a comment function for this homepage?
I tried to comment out different lines in the file _uikit.php, but without success. The result were always PHP error messages... 😞

So now my question to the auditorium, if somebody could help me?

If this question is already answered in the forum and I did not find it by my search, I apologize and would be happy about a link. 

Many thanks and many greetings
Ralf

Share this post


Link to post
Share on other sites

Hi Ralf,

I haven't used comments yet on my sites, but maybe you could add a new "Disable Comments" checkbox field on the "Blog post" template?  Then in site/templates/blog-post.php add a conditional check with PHP that says something like:  If "Disable Comments" is false then show the comment box and comments.

Then just check the box that say's "Disable Comments" when editing the individual blog post pages and the comments/comments form won't be shown when the page is viewed.

Hope that helps

  • Like 1

Share this post


Link to post
Share on other sites

If you don't want comments at all on blog posts, you can just delete the comments field from the blog-post template.

Share this post


Link to post
Share on other sites

Dear @gmclelland,

many thanks for the tips, especially the one with the checkbox I found very interesting.

My customer doesn't want a comment function now, so I commented the whole thing out.
The trick was in the "blog-post.php" file and then a chache problem with my browser why it didn't work at the beginning...

Many thanks again for the tips
cu Ralf

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.

×
×
  • Create New...