#7635 closed enhancement (fixed)
Threaded Comments
Reported by: | ryan | Owned by: | |
---|---|---|---|
Milestone: | 2.7 | Priority: | normal |
Severity: | normal | Version: | |
Component: | General | Keywords: | blessed |
Focuses: | Cc: |
Description
Support threaded comments.
Attachments (14)
Change History (69)
#2
@
16 years ago
Patch introduces wp_list_comments(), which uses a new comment walker class. A custom class can be passed to wp_list_comments() if someone doesn't like the layout in the default class. Ideally, wp_list_comments() would be very customizable so that replacing the walker class isn't necessary.
Default theme patched to use wp_list_comments() and friends.
Two new JS functions ripped from Threaded Comments plugin and cut down to the minimum. The thread expand/collapse from the plugin is not supported and probably won't be a core feature.
This is very, very rough and ugly. First draft.
#4
@
16 years ago
Thoughts on the patch? Does it seem like a good approach to go forward with? If so, I can commit and we can go about getting the bundled themes using the new API and looking decent.
#7
@
16 years ago
Default theme needs styling: Align gravatars on right or move to left. Fix alt for child comments. Fix overlap when replying.
#8
@
16 years ago
It's pretty good, although I think some settings in the admin area (easy enable/disable and perhaps depth of comments spring to mind) might be something to consider for some users.
#9
@
16 years ago
Any options are dependent on if the theme supports threaded comments. If we put options in the admin they won't do anything without theme support. That's not so nice. Maybe we can make it easy for themes to add these settings to a theme options page.
#10
@
16 years ago
Notes:
- supports ol|ul|div style
- if callback registered for start_el, end_el is assumed to have been taken care of by start_el callback
- "class="classname"" html fixed (was quoted)
- Creates Valid XHTML for nested lists, HOWEVER:
- Nested lists must be within their own <li>, The result is that nested lists get a bulletpoint.. You can hide the bullet, but with a <ul> mearly hiding it results in a number being skiped.
- So: Valid XHTML & dodgy numbers with UL, or Invalid XHTML but good list points?
#11
@
16 years ago
So: Valid XHTML & dodgy numbers with UL, or Invalid XHTML but good list points?
It may be i'm mistaken here.
I was certain that a nested list in XHTML had to be
<li>Parent..</li> <li><ul><li>Child</li></ul></li>
(ie. in its own holder)
But it appears thats not the case, the UL can go into the parent list, So this means that a bit more trickery needs to be done.. I'll have a furthur play with it.
#12
@
16 years ago
Eugh, Turned out it was due to the my callback change that buggered it up.
Patch is the same as before, But adds end-callback for overriding end_el(), which is needed if the callback requires something other than </div> or </li>
Also creates valid xhtml now.
#19
@
16 years ago
Added a type argument to wp_list_comments(). Type can be comment, pingback, trackback, or pings. pings includes both tracbacks and pingbacks. Comments are separated with separate_comments(). Themes can call this themselves instead of relying on wp_list_comments() to do it if desired.
#20
follow-up:
↓ 21
@
16 years ago
How about integrating threaded comments into the reply feature in the comments admin? So that, if the selected theme has threaded comments implemented, replys to comments will be threaded under the parent comment.
#21
in reply to:
↑ 20
@
16 years ago
Replying to Speedboxer:
How about integrating threaded comments into the reply feature in the comments admin? So that, if the selected theme has threaded comments implemented, replys to comments will be threaded under the parent comment.
Nevermind, it seems to do this already. :)
#24
@
16 years ago
Maybe we should apply alt styling to entire threads instead of individual comments or drop alt styling altogether. Or, put comment_class() on the comment div instead of the li for list mode.
#28
@
16 years ago
I'm converting my comments.php to use the new stuff. Tricky-ish.
Question: How can I make it default to the last page of comments instead of the first page?
#29
@
16 years ago
Bug: If you're using this, the gravatar size is fixed at 32 px with no way to adjust it other than editing the core code.
What's best? A filter? A global? A parameter to wp_list_comments()?
#30
@
16 years ago
Parameter or perhaps an option in the admin area. Filters and globals are a pain for the average user.
#33
@
16 years ago
A good point was brought up.. If you can do wp_list_comments('type=pings'); or what have you, then it would be nice to know if there are any comments of that type before you call it. Like have_comments('type=pings') or something similar.
This is problematic because as near as I can see, the $wp_query->comments_by_type doesn't get setup until you have already called wp_list_comments with a non-all type. Perhaps the query should always separate the comments when they are pulled out of the DB.
@
16 years ago
Foolin' around with no-JS fallback for replying to comments, may not be ready for commit
#36
@
16 years ago
Patch adds flag to comments_template() for requesting comments to be separated by type.
#39
follow-up:
↓ 40
@
16 years ago
Here's a patch to add an avatar_size parameter to wp_list_comments(). It will let you have the avatar any size you like, or not have it at all with it set to zero. Tested on latest trunk and it works fine.
#40
in reply to:
↑ 39
;
follow-up:
↓ 41
@
16 years ago
Replying to Otto42:
Here's a patch to add an avatar_size parameter to wp_list_comments(). It will let you have the avatar any size you like, or not have it at all with it set to zero. Tested on latest trunk and it works fine.
The get_avatar() call already checks the show_avatar option to determine when avatars should be shown.
#41
in reply to:
↑ 40
@
16 years ago
Replying to josephscott:
Replying to Otto42:
The get_avatar() call already checks the show_avatar option to determine when avatars should be shown.
This lets the theme override that, if desired.
#42
@
16 years ago
Attempting to make the js a bit more generic so it can be used in most themes without changes.
#44
@
16 years ago
The above patch makes several changes: introduces 2 new template tags used to allow replying without js: comment_parent_field() outputs the hidden input field and comment_form_title() outputs a different title for the form when replying (optional).
Changes: cancel_comment_reply_link() takes only one argument text = ' ', the rest is set from js. The DIV surrounding it shouldn't be hidden (for supporting no-js mode) and is optional.
@
16 years ago
Move depth to dropdown per Matt's request + tweak translation stuff (translation stuff needs review)
#48
@
16 years ago
The Walker_Comment's start_el() function needs to pass all the $args, merged with the three fields it must send anyway, down to the comment_reply_link function, making those fields available to be set in the calls to higher level functions.
For example, when calling wp_list_comments, there's currently no way to set the text of the "Reply" link. If the $args were passed along, one could simply add a reply_text parameter to the call.
#49
@
16 years ago
Also, there's still no way to set the avatar_size. Can we get that patch added in already? Having to hack the code manually every time I svn up is getting annoying.
Prior art: http://code.google.com/p/briansthreadedcomments/