Organic Groups Setup

Written Steps

In this video we will create a group content type, as well as modify the article content type to be a group post. Before we get started you must have Drupal installed on you server. I'll be using the standard installation profile for this video series.

Install and Enable Modules

In order to setup Organic Groups we need to install two modules: Organic Groups and Entity API.

Install

Now that the modules are installed, we need to enable a couple of their parts. We will enable: Organic Groups, Organic Groups UI and Entity API.

Enable:

  • Organic Groups
  • Organic Groups UI
  • Entity API

Create Group Type

Now we'll create a content type that will be used for groups.
Go to Structure > Content types > Add content type

  • Name: Group
  • Description: A group can be private or public and have its own set of roles and permissions.
  • Comments are hidden (you could leave these enabled and have a Facebook style comment wall)
  • Group: Group type
  • (Save content type)

Configure Group Content Type

Now let's configure the Article content type to be able to be posted to a group.
There are two ways this can be done, I'll be showing you one way now, and you'll learn the other in the video "Organic groups field settings."

  • Go to Structure > Content types
  • Edit the content type: "Article"
  • Scroll down to the Group tab and select "Group content type"
  • (Save content type)

Create Group #1

Alright now let's create our first group!

  • Go to Add Content > Group
    • Title: Group #1
    • Group type: Group type
    • Body: (Lorem Ipsum)
    • Menu settings: Provide menu link
    • (Save)

Now we see the group. Notice it says "You are the group manager," this is where the "request group membership" link will be for users who are not a member of the group.

This group is currently a public group, with public content, but membership requires approval by the group administrator.
I'll show you how to set up open groups where users can register without having to be approved in the "Group Permissions" video.
I'll also show you how to set groups and/or group content to be private or public in the "Organic groups field settings" video.

For now, let's just post an article to the group

Post an article to the group

  • Go to Add Content > Article
    • Title: Article #1
    • Body: (Lorem Ipsum)
    • Groups audience: Group #1
    • (Save)

Now we see the article, and if we scroll down, we see that it is posted to Group #1.

If you're coming from Organic Groups in Drupal 6… this is where you'll be disappointed, because we're not done yet. When you click on Group #1 you'll see that we're taken to the group page... but there's no sign of Article #1...
In the video "Organic Groups Layout" you'll learn how to display group content on your group homepage.

Comments

thanks a bunch for shining light on OG7 and explaining it in great detail!!!

Brian's picture

You're welcome, and thanks for the donation!

I'm trying to create a simple project management tool with OG on drupal 7
I have created a group named Project and a group content type named Task. I want to have a field named "Who's responsible" in Task content type where you can choose an og user that belongs to the Project Group

How can I achive this? I have tried to use the user reference field (reference module) with a reference view but I failed

Thanks in advance

Brian's picture

The user reference field is the first thing that came to my mind too. I would create a view (probably a clone or variation of the OG Members view) and add a "references" view (instead of block or page). Then you can use that as the options for your user reference field (instead of limiting by role etc.).

Thanks for taking the time to do this series! Extremely helpful!!!!!

Thank you for your great work first. My is question is that while I am creating group and click save, it says "PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mysql.og' doesn't exist:" how can I solve it? Does it requires any patch or something? Thank you in advance.

Brian's picture

That's an issue with the database. It may be due to an older version of OG if you have upgraded. Check out the issue at Drupal.org about this.

First, GREAT tutorial! To the point, no fluff, very useful.
Question: I followed this tutorial. I created a group content type, I added a group named group1, I modified my 'book page' (from the book module) setting the Group Content to 'Group Content Type' (which is now grey... strange!)
When I go to the group page, it does show that I am the 'group manager'
But when I go to the group page as an authenticated user, the page only shows the title and 'published by...' and no content and no 'Request Group Membership' link.
Would you help me resolve this?

Sorry for the long comment!

Brian's picture

Watch Part 3: Organic Groups Layout. It's all in there. :)

I am a dumb semi-newbie and I can't explain how happy I am that I found this video! I'm gonna skip lunch, sit and watch the whole series.

you, as they say, rock.

Search form

Add comment

Comments

  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.