How to get group id as context in Drupal 7 views without panels

I banged my head all day. I saw other posts, but they all seem to say “Use Panels” and I don't want to create a panel page for each view.

I use Drupal 7.x, Organic Groups with Group Context and Views.

I created a content type as a group and several content types as group content types.

In my opinion, I added the relationship Group Membership: Node Group Membership, Group: Node and Content: Author. I tried various context filters, but nobody works.

The view is a display type page with the path node /% / content / documents (documents are the type of content in which I want to show all loaded documents for a specific group).

What is, when I add a context filter, the request contains a string similar to WHERE ((og_node.gid = 'xx')), and the value is the value of the identifier of the node object and not the GID. I set the default value for the context filter for "the current OG group from context", and I set validation criteria to check in the content type of the content → group and node. I can get the page title to use the% 1 placeholder to accurately capture the node group title, but I cannot pass the context so that it is passed, so the WHERE clause contains the GID, not the object identifier.

Any help?

+3
source share
2 answers

I just tried this and the following two parameters worked for me:

  • Communication Group membership: Node group membership
  • Context filter (group membership) OG membership: Group gid

, gid , , , .

- ?

+2

og_context ( og)

0

All Articles