Using views I would like to display the number of posts by a user. This will include a count of nodes as well as comments.


Nodes: 10

Nodes: 22
Comments: 9


I have created a view of type user. I can find the user: content relationship and with aggregation turned on, I can get the node count. However I do not see a user: comment relationship o get the comments that the user has created. Am I missing something?

1 Answer 1


This small Views user: comments relationship patch should be just the ticket: http://drupal.org/node/1773966

...I ended up creating a "User: Comments authored" relationship. Very useful. Combined with aggregation and using "count distinct" it allows a user view to include # comments authored and # of nodes authored.

Direct link to patch: http://drupal.org/files/views-uid_comment_relationship.patch

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.