Last updated 9 July 2013. Created on 26 January 2011.
Edited by spovlot, redben, LeeHunter, naught101. Log in to edit this page.

Introduction:

Since Drupal-7.x, Organic Groups changed a bit and the recommended way to display your group content is with Panels. This guide assumes you have followed steps 1 through 8 of the README.txt that comes with Organic Groups.

Videos:

  • There is a screencast series by bjlewis2 that demonstrates everything in this guide (including steps 1-8 of the README.txt), with a few additions.

Required Modules

Enable subscribe & unsubscribe group links

  1. Go to admin/structure/types/manage, and click on "Manage Display" for the "Group" content type
  2. For the "Group type" field, change the display format to "Group subscription". This will show "Subscribe to group" link for privilege users.

Panel Node template override

The Panel Node template variant is what will allow us to override the default view for Group content types.

  1. Go to admin/structure/panels and under "Manage pages" enable "Node template"
  2. Click Edit.
  3. Click "Add a new variant"
  4. Name it "OG panel" and check on both "Selection rules and Contexts" then click the "Create variant" button
  5. Selection Rules: Select "OG: Node is a group" from the menu drop down then click Add. This will ensure your panel is only used for nodes that are OG groups.
  6. Click Continue
  7. Contexts: Under Contexts, you do not need to add a context.
  8. Under Relationships, choose "OG group from node"
    Note: If you have already created group content node types, there will also be contexts listed like "OG group from Node (on Node:Group Audience)". Do not use these contexts for your group panel. They attempt to get the context from the group content nodes, and will fail, and group-related panes won't appear. You need to use these if you're trying to set up a group content panel.
  9. Click Add Relationship, then click Finish
  10. Click Continue

OG panel content layout

In this section we will layout our panel with two columns 25/75 for our group content.

  1. Select flexible as the panel layout and click Continue
  2. Check the "Disable Drupal blocks/regions" checkbox
  3. Click continue
  4. Click on the "Show layout designer"
  5. On the panel click on the "Row" link and select "Add region to left"
  6. Name it "Left Region" then click Save
  7. Resize the left region to 25% with your mouse by dragging the bar between the Left and Center regions
  8. Click on the "Hide layout designer" button
  9. Click "Create variant"

Add panel content

It's time to populate our newly created panel layout with our group related content

Left region content:

  1. Click on the gears icon to the left of the left region then click "Add content"
  2. Select the "View panes" category from the left
  3. Select "og members" and use Block for view display then click Finish

Center region content:

  1. Click on the gears icon to the left of the center region then click "Add content"
  2. Select the Node category from the left
  3. Select "Node content"
  4. Uncheck "Link title to node"
  5. Select "Full content" for Build mode
  6. Click Finish
  7. Click on the gears icon to the left of the center region then click "Add content"
  8. Select the Views panes category from the left
  9. Select "og nodes" then Continue
  10. Click Finish
  11. Save your panel by clicking on "Update and save" button then view your group page

You should now have a basic understanding of OG and Panels integration. Explore the "contexts" features integrated into panels for organic groups for more flexibility and control of content.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

LoganX’s picture

In step 4 you are directed to "Select the "View panes" category from the left", but as artatac pointed out, this is no longer a displayed option. I found both og members and og nodes in the "Views" category. Ideally this documentation would be updated to reflect this change, but if not hopefully this comment will help people trying to follow these instructions who get lost on this step when they don't see "Views Panes" like they are expecting.

LoganX’s picture

Ugh, except that doesn't work at all. Disregard my previous comment - just a n00b trying to be helpful and failing.

If someone, anyone could tell me how to display items from the group using panels now, it would be most appreciated. Trying to create an intranet w/D7, and have Group pages (ex. HR, Admin, etc.) for each work group... but that won't work very well if I can't figure out how to actually display any of the group content on the page.

camerongreen’s picture

Note, you need to go into Group global permissions at admin/config/group/permissions and enable the non member users to "View Group Type field" as well before they will see the subscribe link.

JoAMoS’s picture

This one small tip has saved me days of frustration.

jaxon77’s picture

Exactly!! The documentation for the module is horrible I feel like I spend all my time just trying to figure out how it is supposed to work by trial and error.

drupsnoop’s picture

Online resources are bereft of a viable solution for creating custom layouts in the Panels module of Drupal 7. Please provide a link or the content for a Drupal guide on custom layout creation in the panels module.

computerology’s picture

totally. i did my best to follow the instructions presented, they were quite confusing and there were missing options in the context creation step as well as in the design builder step.

what happened in the end was the instructions shifted everything on my website to squash into the left hand 25% of the page for all modules and I had to go in an disable the whole variant and remove it to get a fix.

i think that from going through the online resources I have found I may have enough to fumble around and figure it out myself in what will seem to be a drunken stupor.

I really like the idea of this module and give much appreciation to those who contributed and wrote it but this is more like a pre-alpha release. Just following the step by step instructions to create a sample group I've hit so many sections and pages and hard links I'm a network engineer and I'm not even going to remember.

The key question here is.... This module was supposed to allow users to create their own groups??? Just creating my sample group I've hit admin pages I can't give regular users access to at a mile a minute. Keep it simple!

samlj’s picture

Maybe you hit admin pages because you have enabled a different theme for creating content. You can disable that option in the "Appearamce" section.

hypnokayte’s picture

I found this tutorial on Modules Unraveled to be very helpful in setting up a custom layout for Groups in the Panels module.

If you don't feel like sitting through the video, below there are step by step instructions to guide you through the process:

http://modulesunraveled.com/organic-groups/part-3-organic-groups-layout

JayDarnell’s picture

This tutorial would be fantastic if it was still valid. Unfortunately multiple steps in that tutorial call for choosing options that are no longer available in the latest 7.x-2.x-dev copy...

Jay Darnell - CivicActions
Web Designer / Developer / Illustrator

samlj’s picture

As soon as I try to add a context, it brings me a screen in which I must enter a node entity, and identifier, keyword, etc. The ID of the node entity is mandatory, and so I don't know what to do here.
However, in the tutorial provided in the comment above, it doesn't mention the need of an specific context. Is that necessary, and what is it meant to?

Thanks

serum.kolkhos’s picture

In "Panel Node template override" at #7 I have the same problem as samlj: There is no "group content" to check, just the mandatory nodeID. any help would be greatly appreciated

mohamadaliakbari’s picture

zipymonkey’s picture

When you select this you will see the option OG group from context which should do what you want.

Panels 7.x-3.0
OG 7.x-1.3

Z.Monkey

JayDarnell’s picture

I just realized that this step doesn't match up with the directions above for the current dev version as well. In summary steps #7 and #8 in the panel node template override instructions are out of date.

Jay Darnell - CivicActions
Web Designer / Developer / Illustrator

JayDarnell’s picture

I'm using the following modules:

sqlsrv-7.x-1.2 (necessary for using SQL Server database)
Organic Groups - og-7.x-2.x-dev (I have to use this version in order to utilize sqlsrv module)
Entity - entity-7.x-1.0-rc2
Entity Reference - entityreference-7.x-1.x-dev (recommended dev copy)
Chaos Tools - ctools-7.x-1.0
Views - views-7.x-3.3
Views Bulk Operations - views_bulk_operations-7.x-3.x-dev (recommended dev copy)

When I try to set up the Panel Node template override I do not get the "OG group from node" option when trying to set up the necessary relationship.

Jay Darnell - CivicActions
Web Designer / Developer / Illustrator

makdas’s picture

I have the exact same problem!

Panels: 7.x-3.3
OG: 7.x-2.0-beta3
Drupal: 7.17

screenshot >>

redben’s picture

You are using version 2

kingswoodute’s picture

Did you find a solution?

I might try switching back to 7x 1.5 and see if that makes any difference. I will post if it does.

kingswoodute’s picture

Got it,

You don't need to configure this in the new version of Organic Groups. Content shows up without the need to make the connection manually.

andrewfn’s picture

After wasting a couple of hours on this I have discovered that you need to enable the Entityreference prepopulate module to get the link that enables you to create group content. The OG example module forces this dependency, but otherwise there is little documentation.
However you don't need the context (#8), it is now automatic, as correctly pointed out by kingswoodute above.

iannakin’s picture

Absolutely !
And you must enable Views Content Panes (from Ctools) as well in order to have access to the View panes content tab!
It is also required by the OG example module ...

Powergird’s picture

this issue let me crazy ,thanks a lot ,I enable all module which you said above ,but i cant find the "og group from node ",who can help me ?

MatthijsG’s picture

Do you use 7.2.x-branch of OG? It's different, this doc is about 7.1.x ...

======
There are 10 people who can count binary
They who can and they who don't

Sa2015’s picture

I successfully created a Layout for my OG Group. When I try to do te same for the OG group content It doesn't work. The only difference is for my new layout is that I select "OG: Node is an OG group content" instead of "OG: Node is an OG Group" under Selection Rules.
What is could be the reason the content isn't shown?