Hello. I have the next content types:
- medals: to add diferent medals and condecorations (types of medals)
- medals assigment: to asign a medal to an user. It has a cck node reference field to the prior content type, and an user reference field to indicate the user who get the medal (the content is create by admin).
The admin can assign an user more than one medal of the same type.
I would like a view that show medals from user, that is, the view has an argument for the user, and it should show whats medals has been assigned to the user and if he has been assigned more than one medal of the same type, show the count.
Example:
- medals: 1 - medal A
2 - medal B
3 - medal C
- assigment:
uid: 3 medal: 1
uid: 3 medal: 2
uid:3 medal: 1
uid:2 medal: 3
uid:2 medal: 3
uid: 2 medal: 2
The view should display:
if argument: uid = 3 it should display
medal: 1 count: 2
medal: 2 count: 1
if argument: uid = 2 it should display
medal: 2 count: 1
medal: 3 count: 2
Thanks.
Comments
Yes, make a view that takes a
Yes, make a view that takes a "User: uid" as an argument and lists content of type 'medals assigment'. You can then add a relationship using the node reference field from 'medals assigment'. Then you can either display the 'medals' nodes using the relationship or list fields which optionally use the relationship.
Thanks, but the question is
Thanks, but the question is how to do the group by and how to display de count.
I'll do the view as you say, but It doesn't show distinct medals. The "distinct" is aplied to node.nid of "assigment medals".
I have tried with "views
I have tried with "views group by" module, but It doesn't work.
I don't know if it could be done with views module or perhaps I'll need to do on php.