Ralf Posted April 16, 2019 Share Posted April 16, 2019 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 More sharing options...
gmclelland Posted April 25, 2019 Share Posted April 25, 2019 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 1 Link to comment Share on other sites More sharing options...
gmclelland Posted April 25, 2019 Share Posted April 25, 2019 If you don't want comments at all on blog posts, you can just delete the comments field from the blog-post template. Link to comment Share on other sites More sharing options...
Ralf Posted June 21, 2019 Author Share Posted June 21, 2019 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now