Posted by nadavoid on May 7, 2009 at 2:54am
| Project: | Organic groups |
| Version: | 7.x-1.x-dev |
| Component: | Og Views |
| Category: | support request |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
I'm trying to create a view that lists the groups that a user is a member of. Not My groups, but groups of a particular member. This view would be useful, for example, as a block on the side of a profile page.
I am using an argument: "User: Uid"
I have tried using relationship provided by og: "Organic groups: Group node (member)"
The closest I have been able to get is this: I can get the groups that the user owns ("manages").
Is there already a way to do this, and I'm just missing it? If so, I would appreciate any pointers.
Or, please let me know if this functionality is not yet present, and I will change this to a feature request.
Thanks!
Comments
#1
I need to do the same thing, did you have any success?
#2
No, I haven't yet.
#3
Actually this isn't that difficult and easy accomplished with a block view.
* create a block view to display USERS
* as argument choose 'provide default argument' and then 'user ID from url'
* next, create a relationship, choose organic groups (group node relationship, probably the only checkbox)
* now you will be able to add a field -> node -> title - don't forget to use the group node relationship!
that's it. You don't even need a filter. Next you will want to display this block on user profile pages like 'user/8'
The difficulty in using relationships is you not necessarily need to start with the content-type you need to end up with.
#4
It works for Me, even to show Group: Members count field..
#5
I'm fuzzy about the steps you're saying to take to make this view.
1. block view to display users, as opposed to node? I thought we're trying to make a list of groups (which the user belongs to, which are nodes) not users?
2. Where do you see "provide default argument"? I chose "User: UID" and this excluded all groups the user didnt create.
Thanks for any help you can offer
#6
Figured it out - here's some clarification of askibinski's solution
1. create new view of type "User"
2. Click the plus image under "Arguments" to add a new argument of "UID"
3. (You will get errors popping up at this point, but just disregard them)
4. Create a relationship: Organic Groups: Group node (Member)
5. Add a field - I added "node: title" and "organic groups: organic group description"
6. I created a new display of page (I know, OP was asking about block. I was interested in page view.)
7. Path: "user/%/mygroups" to pass the argument to the page
8. Menu: "Tab: My Groups"
#7
This proposed solution still doesn't work for me. It still only shows the groups that the user has created.
And I am using official release 2.0.
#8
tevih's solution worked fine for me (as in, it showed the groups the user was a member of). However, I encountered an error when trying to add the member count field to this view. I have posted this as a separate issue: #683442: Error when creating a view for groups a user is in, with member count
#9
Thanks, Albert. Very useful.
#10
I have followed the steps, and can create the view, and even the link to the manager... but I have tried for an hour and cant figure out how to get "edit Membership " Link like is found in the default "og_my" view... any ideas?
#11
Hi guys,
I stumbled upon this discussion while struggling to find an answer to the problem in question. I finally managed to create a view which displays all the groups of a particular user (on the user's profile page). I'm attaching an export of my view with this post. The steps involved in creating the view are as follows -
1) Create a new view of type - Node
2) Choose the fields which you want to display (node title, node description etc..). I selected the 'node title' field for displaying the titles of the user's groups.
3) Add the argument - "Organic groups: Member of a group". Then under the "Action to take if argument is not present:" title, select "Provide default argument" and then select the "User ID from URL" option (i selected this option since i wanted to display the view on the user profile page). After doing this, save this argument. This is the only argument that needs to be passed (thats right!! no need to pass a separate uid argument).
4) Add the "Node: Type" filter and select the "Is one of" operator and select "Group" for the node type.
That's all!! You can add sorting criteria and more display fields as per your requirements.
Hope this helps....
#12
hkvd: Brilliant and thank you! Your solution was perfect.
#13
Well done hkvd! Just struggled with the same thing and found your post. Problem solved.
#14
Does anybody know how to achieve this in the Drupal 7 version? I need to display all the groups that the user belongs to. Given that some of the "views" namings have changed I'm confused as to how to achieve that. I'm using a Node View... THANKS!
#15
Need to change the version tag to get help with a different version :)
If I thought this issue were still active, I would say create a new issue, as the answer is likely to be different.
#16
Thanks Grayside. Any help on achieving this would be greatly appreciated.
#17
Actually nevermind. Realized that the new OG provides a default view that already does that. Managed to manipulate it to my own needs. Thanks regardless.
#18
Automatically closed -- issue fixed for 2 weeks with no activity.