On a recent project, we needed to split the different content types on the group homepage into different blocks. This is a major pain to do using the Drupal blocks interface, because you need to add php for each blocks visibility settings to only show them on OG pages (and to hide the 'regular' blocks on OG pages).

I came up with the idea of using panels, which should be able to do this much more elegantly. You can simply pass the nid argument into any view panes, each of which can have an OG argument.

Initially I tried the (trivial) approach of redirecting OG nodes to 'mypanel/'. arg(1) - but the issue with that is you loose the menu context (and most importantly, the OG node edit tabs!). I also toyed with inserting the panel in the theme, or trying to relocate the menus but they both quickly became very hackish. The best approach then is to add the panels to the node page, rather than vice versa.

So here is a patch that does this. If panels is enabled (I don't think we want to make it a requirement for OG just yet anyway!) then an interface appears that lets you select between Views and Panels as the main presentation engine, and then select which view or panel should be used. I didn't add any prefixing rules, since that seemed overboard at this point.

When viewing the OG home then, the panel (if selected) is then loaded and appended to the node object. It is then pretty easy in the site theme to integrate this into your regular layout (e.g. by pulling the panel sidebars into your theme regions).

CommentFileSizeAuthor
#21 168036.patch7.41 KBBevan
#16 168036.patch7.35 KBdouggreen
og_panels.patch7.3 KBowen barton

Comments

sovietfunk’s picture

Subscribing. Looking for EXACTLY the same.
Perhaps some kind of per-panel filter would be a way to handle this.
For example: An extra select box for each filter type called "Apply to panel:" with options like "All panels", "Area 1", "Area 2", etc.
Don't have the skills to do this yet, but willing to try.

sovietfunk’s picture

Um, Wow. I'm sorry, I didn't see that this was actually a patch-included-issue. Feel free to ignore the above unless it sounds clever. Will look at the patch.

moshe weitzman’s picture

i've wanted this direction too for a long time. I'm busy, so likely won't get to it for awhile. Hopefully others can review and refine this.

The ultimate vision, which will take a while, is to let the group admins pick their own panel layout from available layouts and put content into each section. Furthermore, ther should be able to make multiple panel pages and assign one as the home page. i would think that the most common content in panel sections are Views, so we might want to give og views integration some attention too. it is fairly stong already so we may defer that.

gracearoha’s picture

How is this coming along and which version of panels does it work with?

owen barton’s picture

This works with panels 1 (it might work with panels 2 beta - I haven't tested).

An alternative implementation, that might be interesting to try out would be to use the new panels as nodes feature of panels 2. If you made the panel nodes into organic groups, then the group maintainer themselves would be able to add arbitrary blocks to their group (with my patch, this can only be done globally by the admin).

We might want to get some patches into panels 2 so that we can offer group owners only a subset of the content normally available in panels (i.e. just a few general views, and some 'og' specific views, that show content for that group, based on the nid argument).

bwong’s picture

Great patch. Definitely want to see this in Panels 2. It would be nice if there was a consistent way to handle formatting and inclusion of fields and data instead of splitting things up into regular presentation, views and panels. Till then, this will definitely help.

bwong’s picture

Ran into a problem with the patch. It seems to clear the group page title. I'm going to check out the code to see what is going on.

Duncan Pierce’s picture

Subscribing

moshe weitzman’s picture

earl mentioned that the next release of panels would be more "context aware" and that this would be a big help to OG. He also mentioned that the panels_node approach is probably unwise. Just recording these wisdoms here. I'm not following Panels2 close enough to grok them fully. I hope others can help with this.

owen barton’s picture

Perhaps we should try and get together at some point in Barcelona to brainstorm how this should work (heck...with a late night coding session we could probably finish this off!).

subspaceeddy’s picture

Hi.

I've been trying panels2 and various cck/other module solutions i've found on the fora (insertview/viewfield/insertblock etc), and this method is by far the most logical and straightforward. It just works as it should and it is in the correct place (on the og config page). As for the generic nature, this is exactly what I need too - i can set a bunch of views to return various bits of content-type based on the current group and it all works fantastically well.

As for panels2, this is already amazing and will be a truly fantastic module. At the moment I couldn't get it to work with OG (i used the node-panel and every other panel/view permutation i could think of. it would let me enter stuff ok, but the output was hijacked by ogs default so the panel never showed - i didn't have time to figure out if that was my problem or a problem with the og/panels2/views interaction). It would seem to me that panels2 would/could be used for customised group pages where this approach is more for generic ones.

Anyway... Just thought i'd add my support for this approach :)

moshe weitzman’s picture

Status: Needs review » Postponed (maintainer needs more info)

try to disable the og_ghp_ron View at admin/build/views and see if panels takes over. it looks like it should based on code in og_view_group(). yes, this should be documented somewhere.

Tom Jacobs’s picture

Grant you work good patch!

i will more options:
how to ?

Group 1 link to panel 1 (other style table)
Group 2 link to panel 2 (other style table)
Group 3 link to panel 3 (other style table)
......

not:
one panel for all group :s

subspaceeddy’s picture

I just re-read what i posted above, and what appeared a clear post when i sent it now confuses me. I think I was elated at getting something to work after plugging away at different options for days.

What I meant to say more clearly was that this patch works really well - in fact it was the only thing that I got to work.

At some point (prob next week when i've uploaded a current working version) i will revisit the panels2 option since that looks very promising, and i will disable og_ghp_ron in views - that was the only thing I didn't try, but now you mention it, it seems obvious. I will download OG4 and panels2, have a go and report back.

douggreen’s picture

Subscribing

douggreen’s picture

StatusFileSize
new7.35 KB

I've got two minor improvements for you so far, which are in og_get_available_panels,

  • select the columns you need instead of using *
  • if the panel title isn't given, display path
henns20’s picture

hmmm...

so - from reading this post...what is the recommended way of going about panels and og integration- panels 2 or panels 1 with patch...any feedback would be much appreciated

Jamie

bejam’s picture

Has anybody got this working with panels2? Have applied the patch and get a panels option in the OG control panel but no panels are listed (also have disabled og_ghp_ron view). Does the panel name/url have to be something specific for og to see it?

henns20’s picture

I have used panels 2 and use them on the groups home page check out this post http://drupal.org/node/166119...i didn't have to apply the patch to the panels 2 alpha 14 to get the panels working

jamie

gracearoha’s picture

I also have it working according to the solution at http://drupal.org/node/166119

you can see a sample of it here:
http://www.universityofhumanunity.org/uhu_development

Bevan’s picture

Version: master » 5.x-4.3
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new7.41 KB

Rerolled for head

dkruglyak’s picture

+1. This is a must-have for groups.

moshe weitzman’s picture

Please do not use the issue queue as a voting system. When a patch is in 'needs review', it is preferable to post reviews such as described at http://drupal.org/patch/review

moshe weitzman’s picture

Status: Needs review » Fixed

I think the new og_panels module resolves this need. Please file new feature requests and bugs as needed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.