I'm using groups (Drupal 7) and have set up panels to show related content for each group. So that if I look at a particular group node it also shows associated group news items, members, etc. The main content is the group body field.

I now want to show a view that displays a list of related content (group messages) for a group as the main content. This should also show the associated group members and news items in a related pane, as it does in the main group panel. I can't see how I can relate the group to the view. It is straightforward to relate the view to the group but not vice versa.

Is it possible to relate the group to the view based on an argument in the path? When I create a new panel the contextual options are all about the node being viewed or the group, but nothing for views or the path.

Or alternatively, is it possible to add a variant to the main group panel page that shows the view I want to display instead of the group body field? How could I create a different context for this? Would it be possible to do it using a path?

Many thanks in advance,


2 Answers 2


You need to setup an extra relation (you can use the default provided og content view). The relation should be: OG membership: Group Content from OG membership The Content group that is associated with the OG membership.

The relation in that one should be OG Membership from node.

Then you can add fields to content as you would, and you can choose Group node from OG membership as a relation. This is how you can pull all info from the main group node.

it's dutch, but shows what you need i think

  • Hi Marcel, thanks very much for your reply, that is very helpful.
    – Ben
    Dec 22, 2013 at 11:36

Is it possible to relate the group to the view based on an argument in the path?

Yes, it is. In the view, in the contextual filters select the radio button "Provide default value", there you can decide which kind of field you want to give. If you want to get the path you should select "Row value from url" and then choose the "path component" (The numbering starts from 1, e.g. on the page admin/structure/types, the 3rd path component is "types".)

I hope this helps you.

  • Hi Syd, thanks for your response. I think I didn't explain myself very clearly. I actually wanted to retrieve the group id from the view, not the other way around. Basically, what I am trying to achieve is two different layouts for the same node using panels. One which has a view as the main content and one which has the group body field as the main content.
    – Ben
    Mar 9, 2012 at 14:45
  • It's better to use Current group from context as a default provided value when working with og and panels
    – Marcel
    Dec 16, 2013 at 19:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.