Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-3.x-dev
Component:
comment data
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
2 Jul 2009 at 09:30 UTC
Updated:
3 May 2017 at 22:33 UTC
Jump to comment: Most recent
Comments
Comment #1
RamMohanSakhamuri commentedIn the Add relationships select comment group from relationship. In the fields you will get options for comment display for parent comments and all..
Comment #2
zman@vail.net commentedAre you referring to adding a relationship in a view? If so I do not see "comment display for parent comments". Could you give me a little more detail about this. I've been trying to get this working to set up a single user blog and I can't seem to fond the correct view settings. Thanks.
Comment #3
jcisio commentedIs this 3.x-specific or applicable to 2.x? I'd like to see this feature implemented, too. I didn't test 3.x, but in 2.8 I can't have it done :( Make the row style as Node shows the threaded comments, but it displays node teaser too.
Comment #4
merlinofchaos commentedViews doesn't currently support a style like this. The nodecomment module has a style (specific to node comments) that can do this. It may be possible to clone this without too much work and use it on regular comments.
Comment #5
artscoop commentedHello,
Well, even though Views doesn't support indenting comments directly, you can do this because even if you sort comments, the children are always displayed under the parent.
Example :
You have 6 comments that you will want to sort according to a value in points :
C1 (10 points)
C2 (3 points)
C3 (5 points)
C4 (15 points)
C5 (5 points)
C6 (20 points)
You want them to be sorted like this :
C6
C4
C1
C3
C2
C5
By using views alone, you will get this (no indentation) :
C6
C4
C1
C3
C2
C5
You luck is that Views uses the comment template file to render the comments.
And, in this comment.tpl.php, you can get the comment depth by using $comment->depth (it will give you a number).
With this depth, you can render a comment nested with CSS properties reflecting your comment depth.
Anf then you will be able to have you desired indentation (close to the pixel) and sorting.
It should work like a charm.
Comment #6
dawehnerrtbc is for patches. Move this to active.
Comment #7
jcisio commentedYou can't just display threaded comment like that, because of the wrong order. How did you manage to get "if you sort comments, the children are always displayed under the parent" done?
I'll leave merlinofchaos "won't fix" this or give any new input for 3.x
Comment #8
merlinofchaos commentedThere's a field in the database that will properly sort comments threaded. You can sort on that and get the right order. #5 has good info in it.
Comment #9
artscoop commentedHello,
Well, actually you can, and if you test you should see it work. I did this with Views 3.x, but this should work fine on Views 2.x too.
Comment #10
jcisio commentedThanks, artscoop. I'll try it. I now remember that field in the comment table.
Comment #11
jcisio commentedThanks, artscoop. I'll try it. I now remember that field in the comment table.
Comment #13
dagmarI have posted a patch for this issue here: #1039494: Support threaded list of comments
Comment #14
chrislabeard commentedI haven't checked out the patch but found another solution that seems to work for what I need. This for all I know might be fixed in views now and I might just not be doing it correctly. Anyways this code works great for me. Basically it just repeats the indented div based on the depth of the comment.
Comment #15
pyxio commentedHi Chris,
I need to created an indented views comment thread, where does this code go? I think views will override this, no? Cheers Kevin
Comment #16
pyxio commentednevermind, i found it. i did not realize views uses standard drupal templates. anyway, i still can't get it work. the problem may be that the who comment is displayed using a views rewrite.
Comment #17
rschwab commentedThis worked for me:
<div class="comment-depth-[thread]">[picture]</div>