Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Because we're talking about social features, it's tempting to go through the hundred plus Drupal 7 modules in the Community category to find the features we want. But instead, I'd like to introduce you to one super module that takes care of a lot of those features, and for the ones it doesn't do, there are other modules that integrate with it. The module is called Organic groups, and you can get it at drupal.org/project/og. One nice thing about Organic groups is that it has a huge user base, and lots of good documentation.
In particular, take a look at this Useful posts for configuring OG. But we'll just go back, and download it. As you see, there are quite a lot of modules here. I'm only going to enable three of them: Organic groups, Organic groups context, and Organic groups UI. We'll be using Organic groups access control later on, when we set up private groups, and we'll also find use for Organic groups field access. But for now, I'll scroll down to the bottom of the page, and save.
Before going on, I think it's important to understand what Organic groups does. It's quite a bit more complicated than the typical module. The best way to see it is to look at groups on other social Web sites; for example, Facebook. The part of Facebook that lets you do what we're going to do in Drupal is this Create Group link down here. I'll just create a Test group, add a Friend to it, as Facebook requires, and Create.
Once you've done that, you've created a forum, where people can write posts, add pictures, or videos, and so forth. It becomes a sort of meeting place, with lots of features which I won't go into here, but this is the same basic idea as Organic groups. In our case, our scenario is that we're going to set up our site as though it's for a political campaign. We'll set up one group as the campaign's headquarters, but also let local activists set up their own local groups, each with its own basic pages, and articles. To do that, we go up and create a content type.
Click Structure, and Content types, and then Add content type. I'll call this Campaign office, and then scroll down to the vertical tabs, where we see a new tab called Group. This is going to be a Group type. You can also define content types as being Group content types; in other words, content that can go into groups. You'll see this a little bit later as we start adding content to this group in a later video. I'll make a few other small changes. First of all, I'm going to turn off commenting, and also turn off the author and date information, and then save.
Now that I've made that content type, I can add a group simply by adding content. Click Add content, and Campaign office. You'll notice that although we said we want this content type to be a Group, you can turn that off on a node by node basis. I've actually found it more useful to hide this, and I use CSS to do that, because when I create a content type to be a Group, I want it to always be a Group, and by hiding this control, I can always force it to do so. If you want to learn more about that, see Drupal 7 Essential Training, and also lynda.com CSS and Drupal theming courses.
I'm going to call this Campaign office, Headquarters. The Body below will be, Where it all happens! And then scroll down to the vertical tabs. I will provide a menu link, just for convenience sake, and then Save. Now let's see how this works by going to a browser where I'm not logged in to my site. There's our node; I'll click on it, and Request group membership. However, you see group membership is predicated on you already being a member of the site.
So let's go back and try this again. Let's say that I'm logged in this time. Now I go back to Headquarters, and Request group membership. Now it starts to go through. We can send a request message, but I want to mention, this doesn't actually go into e-mail, or show up anywhere obvious on the site. However, you can expose it as the administrator using a view. It's a little bit strange that way. Then click Join. Now let's see what that means on the administrative site. Here we are at the Headquarters node again, and if we click Group, we can see what people are part of it.
And there's the person who just joined: tgellar. By default, the person is pending; Iit requires administrative approval, but you can change that yourself. I'll actually approve him. There are quite a few other settings in that Group tab. Let's go back and take a look. First of all, you can manually add people if you want, and you can see what Roles, and Permissions are part of this group. By default, Organic groups sets it up so that all groups have the same Roles, and Permissions.
You can override that later, and I'll show you that in a minute. So we have our group, and so far, it's rather unimpressive. Organic groups are just nodes with members, but those memberships don't mean much. In the next few videos, we're going to take a look at how you can actually make Organic groups useful, but I'll give you a quick peek now by taking a look at some of its configuration options. To do so, go up to Configuration, and then down to the Organic Groups group. I won't talk about all of these right now, but just to give you a sense of them, you can set up membership types, and by default, there's only one.
You can change the permissions that are on in all of the groups, or you can go back and give each group its own permissions by changing the settings. Now, at the beginning of this video, I mentioned that there were a lot of modules that integrate with Organic groups. I wasn't kidding. There's even a category for it in the Module library on drupal.org. We see that by going to drupal.org/ project/modules, filtering by compatibility, and then choosing the Organic Groups group.
So we're just starting down a long road. A lot of the value of Organic groups is hidden by default, and shows up only when you make it visible using the Views, and Panels module, so that's what I'll do next in this course.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 101962 Viewers
61 Video lessons · 88680 Viewers
71 Video lessons · 72487 Viewers
56 Video lessons · 104170 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.