Hi,

I have several group types, like "cars", "planes", etc. I also have a group content type like "events". Events can be posted accross cars, planes groups.

On the frontpage of my site I want to show a list of events from the cars group.
- I added a contextual relationship with group node membership
- but where is the filter by group membership content type?

I can filter by gid, etid_ entity_type etc. etc., but none of that makes sense.

Comments

Anonymous’s picture

Do we really need to create separate content types, e.f.

event_for_cars
event_for_planes
etc.

How can we filter just "events" from all "cars" groups?

firecentaur’s picture

I want to know this as well.

I have several groups
1) Paid Members Group
2) members interested in books
3) members interested in giraffes

I want to create a view to display all users who are:

in the PAID Members group AND also in the Books group

How can I do this?

Please help!

bryancasler’s picture

subscribe

mradcliffe’s picture

I think the only way to do this is to divorce og and og_membership from og_handler_relationship (i.e. create a relationship handler for each one).

The og relationship handler should provide an options form so you can select what entity you want to relate to (Users, Nodes, etc...), and then pull in the base table and field for that entity (that's the challenge there). This, I think, is theoretically possible and I have been playing at it now and then for a while now.

Og_membership handler should work the same as og_handler_relationship works now.

Amitaibu, does this approach sound sane, and if so, may I change the title of the feature request to "Create separate views relationship handlers for og and og_membership"?

amitaibu’s picture

> On the frontpage of my site I want to show a list of events from the cars group.

Isn't it enough to pass in the contextual filters the group ID?

penguininja’s picture

> Isn't it enough to pass in the contextual filters the group ID?

Unfortunately no, because cars is not a group with a unique group ID. It is a group *type* which may contain several cars groups (like "BMW," "Toyota," etc.) each with their own group ID. A potential workaround could be to pass all the individual GIDs to the contextual filter, but that will not work in our case. (We are using OG heavily in an installation profile, so we will not know the GIDs of any of the groups being created by the end users).

jgraham’s picture

I think this should probably close out as this works in 2.x branch with the following steps.

  1. Create a new content view
  2. Filter by "Content: Type", eg. event
  3. Add relationship: "OG membership: OG membership from Node"
  4. Add relationship: "OG membership: Group Node from OG membership", use the relationship created in 3.
  5. Add additional filter criteria "Content: type" and use the relationship from 4. filter by group type, eg. car

I've been reviewing the 2.x branch of og this last week and it is looking fantastic. Huge thanks to Amitai. :)

amitaibu’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Active » Fixed

> I think this should probably close out as this works in 2.x branch with the following steps.

Fine, changing target version.

> I've been reviewing the 2.x branch of og this last week and it is looking fantastic. Huge thanks to Amitai. :)

Happy to read that, thanks for the reviews, issues and patches Jeff :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.