1

I've created a view that lists a number of nodes. I've added the relationship of "comments on node" and then added the comments as a field in the view. The problem I'm having is that if there are multiple comments on the node, the view lists the node multiple times. For instance currently the view displays likes this

Node Title: Title 1
Nid: 1
Node Image: Image
Comment: Comment 1

Node Title: Title 1
Nid: 1
Node Image: Image
Comment: Comment 2

I would like it to be displayed like this;

Node Title: Title 1
Nid: 1
Node Image: Image
Comment: Comment 1
Comment: Comment 2

I know it has something to do with grouping, and that other similar posts have simply recommended grouping by the title field, but this does not achieve the desired results. Am I missing something?

1 Answer 1

0

So far I've only found a couple way of doing this, non of them seem very elegant. If you choose the group by option, it does indeed duplicate all of the fields with the exception of the one you are grouping by. If you omit all the fields form the display, then click on the the grouped field and "rewrite the output" you can use tokens to output all of the fields, and they only display once. Unfortunately, this kinds defeats the purpose of using fields in the first place. The other option is to use the node or teaser view, and make alterations to node.tpl.php and comment.tpl.php as needed ....

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.