Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
theme system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
13 Jul 2009 at 15:27 UTC
Updated:
1 Dec 2010 at 09:53 UTC
Jump to comment: Most recent file
Comments
Comment #1
johnalbinAdding issue tag
Comment #2
michelleThis may be a little "out there" but how about a string in the UI per content type? Default it to "Comments" (translated) and you can wipe it out to not have anything. Could default the forum node type to not have anything and then other types that get added to the forum vocab need to be taken care of by the site admin.
Michelle
Comment #3
kika commentedWhy not introduce comment-*nodetype*.tpl.php and comment-wrapper-*nodetype*.tpl.php and overwrite comments header in forum-specific comment templates?
Comment #4
johnalbin@kika Yep, that's what #279573: Themes can't use node-story.tpl.php without node.tpl.php would allow us to do. I think its the cleanest solution. :-) Unfortunately, its an outstanding bug that has not been fixed in a year and a half. :-(
@Michelle That's not a bad solution either. But I'm always hesitant to add more checkboxes to core. I don't quite see "adding a comment heading" as a compelling reason for more UI. :-\
I just remembered that comment-wrapper.tpl doesn't have a $node variable like the comment.tpl does. That would probably be useful. So let's make that #4 on the to-do list.
Comment #5
michelle@JohnAlbin: I wasn't thinking of a checkbox. I was thinking more akin to being able to name the "body" field or delete contents of the textbox entirely to not have one. In this case, you would give the name of the "comments header", which would default to "Comments", or delete the word "Comments" to not have a header at all.
Michelle
Comment #6
j_shb commentedConcerning issue #2:
I'm new-ish to Drupal, but here's an issue I've run across. Even when there are no comments on a node, the comment-title heading (in my case, "COMMENTS") is shown. The reason for this in my comment-wrapper template is that the conditions to print the title are (1) the existence of $content (usually true because the comment form is included in $content) and (2) the node-type isn't a forum. Both of these are met for most of my nodes, regardless of whether or not there are no comments. Therefore, I've added another condition (maybe improper) but it hides "COMMENTS" when there aren't comments.
With this code, if the first thing in $content is the opening div for the comment form, the title "COMMENTS" doesn't print. Thought I'd share.
Comment #7
kika commentedThere are references to depreciated collapsed comments display modes in comment-wrapper.tpl.php. #506218: Remove collapsed comments and tidy up settings was meant to fix this but that template got missed.
Comment #8
yched commented[edited out, was talking nonsense]
Comment #9
yched commentedActually, it turns out this needs to be part of #523950: Update comment rendering. Patch #35 takes care of that - quite easy change once the way is paved by the other refactorings in there.
Comment #10
johnalbinRe-opening since I see what appears to be a superfluous
<div>in comment-wrapper.tpl.Comment #11
yched commentedNote that the div around the 'add new comment' form (that's the one you're talking about, right ?) was already present before #523950: Update comment rendering, we just mirrored the existing markup.
But true, that could probably be enhanced. Should be much easier now that what was scattered across several theme functions is now inside a single template :-)
Comment #12
johnalbinBut its really nice to see all 3 of the points I brought up in the issue description to already be fixed. Yay, team!
So the minor things I see that still need cleanup are:
<div>around$content['comment_form']. The form already has a wrapping div, so the one in the tpl is superfluous.<h2 class="comments">and the<h2 class="title">need some work. I feel like the h2 above the actual comments should have the "title" class and the h2 above the form should have something like "title comment-form".Anybody else see anything?
Here's a patch that does #1 and #2.
Comment #14
lilou commentedHEAD is broken.
Comment #15
moshe weitzman commentedThe number/distribution of exceptions is surprising. Bot error?
Comment #16
johnalbinI also noticed that the "Comments" title is still printed even if there are no comments and we are only printing the "Post new comment" form.
Er… "post"? We're not using that term anymore in other places in core. We should change that title to "Add new comment".
To review, this patch:
<div>around the new comment form.With this patch, this is how you differentiate between node, comment-wrapper, comment form, and comment titles:
node title:
.node h2.titlecomment wrapper title:
.comment-wrapper h2.titlecomment form title:
.comment-wrapper h2.comment-formcomment title:
.comment h2.titleSince the comment form title still has the "title" class, you'll also be able to style all h2 titles using
h2.title.Comment #17
robloachI like this patch. Another issue touching the same code is #539216: Comment form above comments.
Comment #19
effulgentsia commentedDarn. I like this patch, but seems too late now for D7. Correct me if I'm wrong.
Comment #20
moshe weitzman commentedit is not a compatibility break, and it brings string consistency ("Add new comment"). IMO is eligible for D7
Comment #21
moshe weitzman commented#16: comment-wrapper-tweak-517850-16.patch queued for re-testing.
Comment #22
effulgentsia commentedJohn, Rob, and I like it, and Moshe says it's eligible, so RTBC: let's see what webchick says.
Comment #23
dries commentedCommitted to CVS HEAD. Thanks.