Jump to content

Theme Regular - Disable Comments


Ralf
 Share

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

Link to comment
Share on other sites

  • 2 weeks later...

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
Link to comment
Share on other sites

  • 1 month later...

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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...