Organic Groups Field Settings

Written Steps

By default, groups are public with public content. In this video I'll show you how to create private groups, that can have private and/or public content, as well as public groups that can have private and/or public content. That may sound a little confusing, but believe me it will make sense when you see it working. So let's dive right in.

In order to configure group access control, we need to enable the module: Organic groups access control. Then rebuild the permissions.

Enable

  • Organic groups access control
  • Rebuild permissions

Create a private group

To create private groups we need to venture into our first section of Organic Groups settings.

  • Go to Configuration > Organic groups field settings

There are a number of bundles that can be chosen here, and in this case, we're going to choose the Group bundle.

  • Bundle: Group

There are two sections of fields: one for groups, and one for group content. In general, you don't want to give a group field to something that is group content, or a group content field to something that is a group.
In order to create private groups, we want to add the Group visibility field.

  • Fields: Group visibility
  • (Add field)

Now, let's create a private group

  • Go to Add content > Group
    • Title: Private Group #1
    • Body: (Lorem Ipsum)

Scroll down and you'll see that we can set the group visibility to public (default) or private. If a group is public, all site users, including anonymous users can see the group. If a group is private, only members of the group can see the group on the site. Let's set it to private.

  • Group visibility: Private
  • Menu settings: Provide a menu link
  • (Save)

Now we see Private Group #1, and it's menu link. However, if we switch over to Safari, we won't see the menu link, and in fact, we can even type in the link directly, and all we'll see is an access denied page.

Create a private article in a private group

In order to allow articles to be private, we need to head back to the Organic Groups field settings. Select the article bundle, and add the field “Groups content visibility”.

  • Go to Configuration > Organic groups field settings
    • Bundle: Article
    • Fields: Group content visibility
    • (Add field)

Note: the option "Groups audience" enables a content type to be posted to a group, making it group content. This is the second way to accomplish this as mentioned in the first video "Organic Groups Setup." It can be faster to add this field here if you have a number of content types created before you install Organic Groups. While it may be just as fast to add the field like we did in the first video, when creating a new content type.

Now, let's create our private article

  • Go to Add content > Article
    • Title: Private Article #1
    • Body: Lorem Ipsum
    • Group Audience: Private Group #1
    • Group content visibility: Use Group Defaults
    • (Save)

Now we see Private Article #1. However, if we switch over to Safari and go home, once again, we don't see the article, and once again, we can type in the link directly, and all we'll see is an access denied page.

Create a public article in a private group

This time, we'll create a public article inside a typically private group

  • Go to Add content > Article
    • Title: Article #2
    • Body: (Lorem Ipsum)

Scroll down and set the group audience to Private Group #1. Just below the Groups audience field, we have the Group content visibility field. Our three options are:

  1. Public will make the post accessible to anyone (even anonymous users).
  2. Private will restrict access to only group members.
  3. Use group defaults, is probably what you will use in most cases, but since the group is private, and I want the content to be public, I will override that here.
  • Groups audience: Private Group #1
  • Group content visibility: Public
  • (Save)

Now we see Article #2, and if we switch over to Safari and go home, we can still see Article #2.

Create a public group

Now let's create a public group

  • Go to Add content > Group
    • Title: Group #2
    • Body: (Lorem Ipsum)
  • Group visibility: Public
  • Menu settings: Provide a menu link
  • (Save)

We can switch over to Safari and see that Group #2 is indeed a public group.

Create a public article in a public group

Creating a public article in a public group is easy

  • Go to Add content > Article
    • Title: Article #3
    • Body: (Lorem Ipsum)
  • Groups audience: Group #2
  • Group content visibility: Use group defaults
  • (Save)

Since the group is public, the article is too.

Create a private article in a public group

Let's create a private article in a public group

  • Go to Add content > Article
    • Title: Private Article #2
    • Body: (Lorem Ipsum)
  • Groups audience: Group #2
  • Group content visibility: Private
  • (Save)

We can see Private Article #2, but no sign of it in Safari.
This could be useful when you have a group where most content is public, but occasionally want to post something just for group members.

In the Organic groups field settings, you may have noticed one more field option "Group roles and permissions". This is covered in the "Organic groups global roles" video, as well as the "Organic groups global permissions" video.

Comments

Hi Brian,

My name is Anuar and I'm a computer science student working on a project, having a hard time here with drupal. First of all, thanks a lot for your videos! they have been extremely useful for someone whose never used drupal before. Ok so my problem is, i've been following your tutorial, and I'm working on a page thats hosted on one of my teammate's server, everything's been going well, but when I tried to start this tutorial, when I checked in the configuration window, the options for OG were not there at all. I was dumbfounded, for I then checked configuration on my local drupal page (hosted on my machine and it also has OG installed) and the options to configure OGs was there. I'm really confused as to why this is happening and your help would be extremely appreciated. Thanks for your time.

Brian's picture

It sounds like OG is either not installed, or not enabled. Start from the beginning of this series on your teammates server.

Bravo for a very informative series of videos.

I have a question: How do you limit access to the creation of private groups based on roles?

Thanks for any tip and suggestion.

Hello Brian, thanks for the series.

I have a question: How can I show the link to request membership to a private group? I dont want to show any content, users or anything else about the group, but just the name of the group and the link to request membership. Is it possible do you think?

I have a req like the private group should be listed but when clicked on the group home page the request membership link should come up. I have spent lot of time on screen casts and tuts but no luck. Please let me know if you have figured out any solution.

Thanks

First of all i would like thank you for such a good series of tutorials. i have learnt a lot from them.
I have a doubt that how do I enforce creation of only private articles by group members in a private group??? As of now the member can decide the visibility. Is there any way to remove that option???

At the point that you turn up private groups, you might want to make a note that if it is still visible to Annonymous users, then you may have a conflict with other access control schemes. See here for more info: http://drupal.org/node/868904

I too can't see view panes. I also don't seem to be able to uninstall og, it just won't go away even when I directly remove the file from my server, it doesn't stay gone, so doing the best I can with instructions and no view panes I get everything except the body content showing up. Is there an order to the installation. Do I use the devel module or the stable one??????

Brian's picture

I've been using the stable version of the 1.x branch. However, if you can't uninstall OG, there's probably some other issue with your setup...

Thanks for the really quick response-
my setup as may be---- but am I still looking for view panes? Why does it not show up? Do the modules need to be loaded in some order-your video doesn't seem so-looks like you do them all simultaneously. I will try to peel back to the beginning.

have started over several times, have fresh og 7.1.4, but no view panes, where do I get it? see others run into same thing but answer is never clear. Help. Please.

Brian's picture

I'm sorry you're having issues. As far as I know, as long as you have the "Views content panes" module enabled (and have at least one view pane created), you should be able to see the view panes.

Brian, thanks for being so quick in your response and for being sympathetic--- guess what? i created a dummy pane in views after enbling view panes module in ctools and "view panes" showed up in my menu for the first time..... off I go again. wish me luck!

when i got to the view panes part of the panel and selected it there was nothing inside except my dummy pane, not the choices your video shows- now what?

another halting step forward, I needed to create pane views for the content and members page views so they would register in the view panes, needed to refresh a few times too. will keep you posted

modest progress mixing several video from various sources, have content posting but not controllable, panels still balky

Brian, I know this takes up space but it is 6 days and 60 hours later and I am still trying to get og to work. At the moment I have 7.14 installed and two screwy things are happening. If I put in new content to my original group it won't show up. If I put it in the second group it shows in the first, If the 3rd it goes in the second. I created a 4th and 5th group much later and any attempts to put content in them is ignored. Nothing will display in group 3, 4 or 5. Any ignored content when placed subsequently in either group 3 or 2 by making a group audience selection then moves the content and displays it in group 1 and 2 as described above.
I have learned a lot, but not enough! I am doing a single site install with 7.2 dev and it is ignoring your instructions-just starting down that road now.

Is it possible to add more options than "Public" and "Private"? I'd like a third option to show group content based on logged in users and non-logged in users.

I thought group visibility was a list field, but now it's a boolean field - not sure when that changed.

HI Brian,
I am facing a issue about that og calendar. I reference the D7 og calendar(http://drupal.org/node/1268156). And now, the calendar display under the group is currently. But, the data(or, we can say event not display in calendar). Would you please teach me that how to check it this issue. Many thanks.

Brian's picture

I haven't ever made a group specific calendar, but that page looks like it has step by step instructions. I'd say follow those tips exactly and you should be good...

Hi Brain,

Thanks for the great videos.

I go to configuration > Organics groups field setting.
From the Bundles drop down menu, I don´t have the option to select ´Group´

On the video I see you have the following fields:
User - User entity
Article - Node entity
Group - Node entity

I have:
Administrative Unit - Node entity
Department - Node entity
Announcement - Node entity

I am using the Julio distribution. with Organic groups field setting 7.x-2.0-rc1

I hope you can help

Hi Brain,

I chose the Department from the Bundles and Group visibility from the fields.
I now have the option to make my departments private - great.

Many thanks

Hello Brian,

Since I have made my groups private all content is no longer visible, including announcements.

When I am logged in as an administrator I can see the content for the groups and the announcements. When I log-in as a group member I can see the the title of the page but no content. It´s the same with the announcement, I have the link and when I press it I only see the details about who submitted the announcement, but no content.

All content and announcements were visible before I made the groups private.

Any ideas?

Brian's picture

That's most likely due to permissions. Check out video 8 Global Group Permissions, and video 10 Group Specific Permissions.

Thanks for pointing me in the right direction

Can you please help me get this fixed? I folloewed your steps and ended up with this. I am on 7.21 and can not find a video to help me do it in this version, thats what got me here :).... Notice: Undefined offset: 1 in og_membership_from_group_and_user_context() (line 28 of \Sites\acquia-drupal\sites\all\modules\og\plugins\relationships\og_membership_from_group_and_user.inc).

Dreao

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.