How do I pass an organic groups GID to a view in a pane? I have a drupal 7 site using Organic Groups, for each group I have list pages - so for instance if i have the group mygroup I have a page which lists all posts - (www.mysite.com/groups/mygroup/posts). This page has a groups audiance field (og_group_ref) which has the correct gid..

I have the list page set up with panes one of which is a view showing all posts with the contextual filter set to GID.

The view works on its own if I pass in the GID of the group I want, however, I cannot get this to cooperate with the list page, probably something to do with the pane, or panels, or a relationship I need to add to the view?

I've tried inserting the view into the pane as a content pane and as a block, but I'm having no joy... 

What do I need to do to get this to work?

I have since found this post:

How do you display a pane in an organic group?

this seems to be the answer to what I'm looking to do, however, the settings shown in that post are not available to me. Maybe because panels/views/og have been updated and the settings are a little different now? Either way I still don't have this working. Does anyone have any pointers?
Solved it like this:


Create a "Content pane" view mode of your view, and set "Argument input: Input on pane config".
Create a contextual filter in your view that expects a group ID value.
Enable the "Tokens" display mode for content type with the og_group_ref field. According to here:


Go to "Structure → Content Types → [your content type] → Manage Display".
Click "Custom Display Settings" below the field list, enable the "Token" option and save.
Go to the new "Token" display mode in the horizontal tabs on the top.
For yourog_group_ref field, set "Format: Entity id" and save.

In the Panels configuration of your list, insert your View pane.
In the View pane config form, there will be a single input field expecting a gid value and saying "You may use keywords for substitutions." below. Enter %node:og_group_ref.


How I think it works: Panels allows CTools context keywords when supplying arguments to panels. These context keywords are automatically available for all fields (%node:nid works out of the box) and all defined tokens (examples). But for fields, they evaluate to the formatted field value, such as your group's name. We could change this behavior by defining a token of the same name, and choosing a formatter that outputs the raw value (the number) when that token is evaluated.

References:


This Drupal SO question, providing the basic technique.