A client I'm working with wanted the ability to hide the 'Comment' title in the comment-wrapper.tpl.php when no comments are present. If no comments are present and a user adds a comment, the comment header should appear. If there are comments present and an admin deletes all the comments the header should be removed.

My first attempt at a solution for this is attached as a patch. In my solution I added a new configuration option to enable or disable the hiding of the header. If the option is enabled it will apply the requested logic to the h2 with the 'comments' class if a div with class 'comment' appears. While the class names should probably be set on the configuration page, I didn't have the time to do that so I went with the default way things are currently being done.

This has only been tested in the scenario required for my client's project so if someone can review and provide feedback I'd greatly appreciate it?

Thanks

CommentFileSizeAuthor
hide_comment_header.patch4.08 KBd.clarke

Comments

rjbrown99’s picture

I'd like to hear from the original author as well as anyone else: do you still need/want this feature in the module? The issue has been dormant for more than a year.

neochief’s picture

Well, I don't have strong objections about this feature. However, I have a filling that it will be used by 1 user from ten thousand, but it makes code looks even more crappy than it is right now.

rjbrown99’s picture

Status: Needs review » Closed (won't fix)

I tend to agree - how about won't fix for now?

d.clarke’s picture

The client still uses this solution. Its a UX question/issue really. The issue is that if you have no comments, then it displays "Comments" followed by "Add a comment". If there are no comments it doesn't make sense to display "Comments" since there are none, it just clutters up the page. Once a user adds a comment via AJAX though it makes sense to have the "Comments" header. If you don't feel like it makes sense, thats fine, but I do think there is a UX issue there that should be resolved.