Getting Group Detail block to appear in Panel on non-group node

Events happening in the community are now at Drupal community events on www.drupal.org.
west_d_r's picture

Hopefully someone else has encountered this. I've used panels to take over a page generated by the Calendar Module. The Calendar view inserts the node ID as an argument into the url, (1646 below).

http://mysite.com/group/1646/calendar/2008/9/15

However, the organic Groups panes don't recognize this argument, because
1) You can't insert them unless you restrict the Panel Page to a "Group enable" content type
2) The Calendar URL that I'm taking over is not a node, so it can't find the ID.

Any advice on this? If I knew php it seems like a simple proposition to write some code in a custom block that would return the details and other group specific info.

Why do I need this? Because clicking on a Calendar link directs away from the group to this view where you have no navigation back to the group.

I'm open to other navigation work arounds.

Comments

Use a custom theme_breadcrumb?

dwees's picture

You could try customizing theme_breadcrumb. When all else fails, it is possible to include some logic in your theme functions.

The idea here is, you would examine the arguments of the page and use these to determine the appropriate breadcrumb trail. I have noticed too that often the breadcrumb trails are lost on non-node group pages.

Dave

If you can get the argument, can't you get the ID?

west_d_r's picture

Thanks for the breadcrumb idea, but if I can get the breadcrumb to examine the url argument, then I should be able to get a block to do so as well. Right? I'll look at the custom breadcrumb code from the vineyard voice instructions and see if I can piece something together. Not being a coder that will be interesting.

RTM - $group places the group ID in the URL

west_d_r's picture

If one reads the directions on the views page, placing $group as an argument in the view url will enable the group ID to display and will render the blocks correctly.

I have a similar problem

pimousse98's picture

Could anyone help me?
I have multiple panels - one is the group home page (so far so good: /projects/%pid/) and two are panels with embedded views which take an argument from the URL (/projects/%pid/data/ and so on).
These panels consist of 1. project information (a view) 2. project links (og info block) and 3. a listing of nodes of that type.
If there are "data" nodes to be displayed in these panels, then the og info block shows as expected (context is set). However if there are no "data" nodes for the project then the OG context is lost, so the block (#2) does not display.
I have tried several options with the panel context, using og-panels (and without)... which don't solve the problem (if I set the argument to be an "organic group" instead of NID then the page does not even load anymore!
I realize the solution is to use og_set_group_context() but I am not sure where to do it (hooks?) so that it takes effect early enough to make the block visible.
I have also seen references to using a path like og/something/gid for automatic context setting, but I really would like to keep my current paths.
Has anyone found the solution for this?
Thanks

Delphine

My solution

pimousse98's picture

Or rather, a hack. I did the set_group_context() thing inside of the "empty" text for my view that is embedded in the page. For some reason it succeeds in setting the group context before the block is created.

Panels

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week