3

I have been banging my head all day with this. I have seen other posts, but they all seem to say "Use Panels" and I dont want to make a panel page for every view.

I am using 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 view, I added the relationships Group Membership:Node group membership, Group: Node, and Content:Author. I have tried various Contextual filters, but none seem to be working.

The view is display type page, with a path of node/%/content/documents (documents is the content type where I want to show all uploaded documents for a particular group).

What is see is whenever I add a contextual filter, the query contains a line similar to WHERE ((og_node.gid = 'xx')) and the value there is the value of the group node entity ID, and not the GID. I have set the default value on the contextual filter to "current OG Group from context" and I have set the validation criteria to validate on the Content ->group content type, and Node ID. I can get the Page Display title to use the %1 placeholder to accurately grab the Group Node title successfully, but I cant get context to be passed in so the WHERE clause contains the GID and not the entity id.

Any help?

ekad
  • 14,436
  • 26
  • 44
  • 46
Scott Shipman
  • 31
  • 1
  • 3

2 Answers2

2

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

  1. Relationship of Group membership: Node group membership
  2. Contextual filter of (group membership) OG membership: Group gid

In the preview window, when I enter in the gid for the contextual filter, I get back exactly the nodes belonging to that group that I expect.

Have you tried that one yet?

magdmartin
  • 1,712
  • 3
  • 20
  • 43
Boriana Ditcheva
  • 1,995
  • 15
  • 26
  • Much more detailed answer here (by Boriana too): http://drupal.stackexchange.com/questions/39750/how-do-i-display-all-the-nodes-in-an-organic-group – magdmartin Jan 07 '14 at 20:46
0

You can try the og_context module (part of og)

alberto56
  • 2,997
  • 3
  • 28
  • 47