Question

I'm trying to display on a views, only the nodes which the user is part of the Organic group.

I have a field og_group_ref in my content type which relate to a group.

What I want is for each user, display only the one he his part of. It seems relationship is the trick but somehow I can't make it work .

So far I tried in Relationship:

 OG membership: OG membership from Node group 

(OG membership from node group) OG membership: User from OG    membership

and to add in contextual filter:

(user from OG membership) User: Uid (with default value set to "user id from logged in user")

But it doesn't seem to work!

Was it helpful?

Solution

You just need to add OG membership: Group ID as a contextual filter,
click Provide Default: The OG groups of the logged in user
and under More at the bottom of the filter's settings,
click Allow multiple values.

Licensed under: CC-BY-SA with attribution
Not affiliated with drupal.stackexchange
scroll top