ZenphotoCMS Forum
Hiding "No Comments" and "Closed for comments." - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Hiding "No Comments" and "Closed for comments." (/thread-8572.html)



Hiding "No Comments" and "Closed for comments." - toxalot - 2011-05-03

Is there a way to hide "No Comments" and "Closed for comments."?

I was hoping that I could control it in the theme or that there might be a CSS class that I could set to display: none, but there doesn't appear to be.

I could edit the PHP file directly, but I would prefer not to edit core files directly.

From what I can see, I can have a local copy of the comment_form/comment_form.php file, but the same doesn't hold true for the main comment_form.php file.

Ideally, there would be a class such as "no-comments" applied to the "No Comments" h3 and a class of "comments-closed" applied to the "Closed for comments." h3 and the "Subscribe to comments" link, when applicable.

Is there a way I can do this myself? Is there a possibility of having this added in the future?




Hiding "No Comments" and "Closed for comments." - acrylian - 2011-05-03

You can make a custom plugin of this. Or you just add a check if there are comments or closed and hide the form inclusion completely. See the documentation.




Hiding "No Comments" and "Closed for comments." - sbillard - 2011-05-03

A class added to the h3 is a good idea. It will be in the 1.4.1 release. You can preview it in the development nightly builds (after tonight, so that the change is there) The h3 will have class="empty" added.




Hiding "No Comments" and "Closed for comments." - acrylian - 2011-05-04

I would ten suggest to give it a speaking name indeed like "no-comments" or "comments-closed". Of course the wrapper div will still be there.




Hiding "No Comments" and "Closed for comments." - toxalot - 2011-05-07

To be clear, there are two separate items: whether or not there are comments and whether or not comments are open. You can have no comments and have comments open. I assume you can also have comments and have comments closed.

It would be nice to know both and have them nested. For example, if comments are closed and there are no comments, I could remove the whole block. But if there are comments and comments are closed, I'd like to let the user know that comments are closed.

I'm not sure it's possible to achieve what I'd like with just adding a few classes to the current HTML. I may end up writing my own plugin.




Hiding "No Comments" and "Closed for comments." - acrylian - 2011-05-07

You could easily hide the printCommentForm call with an if check if there are actually comments using getCommentCount().