Posted by MrMason on October 5, 2011 at 8:08pm
I am looking to create a view that will only show nodes that are in the groups that the user is in. Does anyone have any experience in this. If someone could just tell me the configuration for the filters that would be awesome.
Comments
Use Contextual Filters
I'm not sure how you would do this in D6 but in D7, in your view under advanced, you will find Contextual Filters. You should be able to add a filter for Group Membership. I have used this for creating a view that creates links to all content within a group.
Note: You will more than likely need to click the add default value when the filter value is NOT available radio button.
I would like to know how to
I would like to know how to do this in D6 if anyone has figured this out.
I would like to know how to
I would like to know how to do this in D6 if anyone has figured this out.
How to do it in D6
In "relationships" add
Organic groups: Group node (post)
In "Filters" add
Organic groups: Group member
and
select the relationship
Group node (post)
and
Is the logged in user: True
That will filter only nodes that are in groups that the current user is in. Works for me.
The Organic groups Views integration module will need to be activated. (It is part of OG)
Thank you! That is exactly
Thank you! That is exactly what I needed.
Just to add to awasson's
Just to add to awasson's answer for doing this in D7, you need to first create the relationship '(OG membership from node) OG membership: Group Node from OG membership' before you can setup the contextual filters.
This isn't as much of a problem anyway, as OG creates this view template by default anyway, although you can use its configuration (or clone it) to use it for other things.