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
| Comment | File | Size | Author |
|---|---|---|---|
| hide_comment_header.patch | 4.08 KB | d.clarke |
Comments
Comment #1
rjbrown99 commentedI'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.
Comment #2
neochief commentedWell, 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.
Comment #3
rjbrown99 commentedI tend to agree - how about won't fix for now?
Comment #4
d.clarke commentedThe 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.