Problem/Motivation

I downloaded and installed og_subgroups on a test instance of Drupal 7.9. I've enabled it. And I've looked all over trying to figure out how to create a sub group. I can't find anything. The d.o docs don't help, the readme is pretty much empty, and the two issues I was able to find (http://drupal.org/node/1226002 and http://drupal.org/node/1320920) that seemed related didn't help.

So, how do I create a subgroup right after I've enabled the subgroup module?

If you could answer in a way that could transfer to the d.o docs pages, that would be awesome. :)

Attached is a screen shot of my modules page so you can see what versions I have installed, and what is enabled.

CommentFileSizeAuthor
Modules | Lane OG Testing.png1.74 MBjerrac

Comments

johaziel’s picture

+1

creact’s picture

I have the same problem. I can not figure out how to control this module. How do you make a sub-group???

IronWorker’s picture

when you create the node of the group you want, use the group audience to connect it to the group you want to be a sub group of.

creact’s picture

I shall try that. Thank you for your quick response. It is much appreciated.

creact’s picture

I am sorry but I can not get this to work at all. Could you give me a step by step? I do not seem to have the subgroup or visibility field options at all.

IronWorker’s picture

D7 is more flexible but also more obtuse that D6 implementation it appears.

Let's say I have a content type called "District"

First thing you want to do is to go to administration->configuration->organic groups->OG field settings (admin/config/group/fields)

Pick your "District" in the list of content types there.

You should see "Groups Audience" as a field. If you don't, select your node type from the bundles dropdown and in the fields drop down, select "group audience" and save it. If you want to go one further, add "group visibility" and "group content visibility" to it too. This is extra credit.

Back to structure. Edit the "District node type" you should see down at the bottom a group tab under the menu settings tab. Make sure this has "group type" and "not a group content type" -- this marks the thing as a group as opposed to say a group aware article.

Now create a content instance called District 1 from the district type. Mark the node as "group type" and leave the audience field alone. Fill out the rest of it as the mood strikes.

Create another content instance called District 2 from the district type. Mark the node as "group type" but now select "District 1" in the group audience field.

You've now made District 2 a subgroup of District 1.

Getting this to flow between them is another trick in D7 that I haven't mastered largely because og_subgroups for D7 is still in a state of flux. I haven't tried doing anything with this lately but it documentation looks like it's working better than it used to (which wasn't at all except for permissions).

creact’s picture

I will try this asap. Thank you so much for your time. I appreciate it more than you know. Drupal frustrates the hell out of me since I am more of a visual person and need everything in one place and "touchable"...

Thanks again.

creact’s picture

Status: Active » Closed (works as designed)

IronWorker,

You are MY HERO. Finally this thing makes sense... well mostly... and I learned a lot about drupal core in the process too.
Thank you so much for your patience and common sense approach. You are awesome !

IronWorker’s picture

you bet.

Just helping out a fellow traveler in this very confusing jungle...

newmember’s picture

IronWorker, this was a great step by step process. Thanks
The idea of adding "group visibility" and "group content visibility" is interesting and at first well hidden, but the OG is looking cool for D7.

In D6 there was an option for setting permissions on groups between groups, siblings, parents, children could see the content of that group. Is there a similar thing in D7?

EG:
District (Group)
\--Block (Group)
\---House (Group)
\--Family (node)

If I add a Family node to House group and House group is a child to Block and child to District, that when I add Family automatically District would see the Family node IF I had set "Parents" in the hierarchy permissions.

Thanks
Chris

IronWorker’s picture

Not an expert in this subject but:

Supposedly the relationships of groups will roll down the permissions from parent to child.

Content has until recently not been available on D7. Looking at some of the recent posts in this module, the functionality is just starting to get there for getting content to show up and down the chain.

Best thing is to try it and see if it works yet. Didn't awhile ago.

Wish I could be of more help to you

newmember’s picture

Follow up.

I found lots of discussion about this, I will wait for the module to be updated.
http://drupal.org/node/1342632
http://drupal.org/node/1226002

Thanks

Sinan Erdem’s picture

IronWorker, at comment #6 you say that:

Edit the "District node type" you should see down at the bottom a group tab under the menu settings tab. Make sure this has "group type" and "not a group content type"

But on that field, it states that:

Group content
Set the content type to be a group content, that can be associated with groups.
To unset the group content definition or change the settings you should delete the "Groups audience" field via Manage fields.

Without deleting the "groups audience" field, we cannot remove the check near this. How did you get this work? Did you try adding a user to a group that has a subgroup or parent group? It doesnt work for me. See: #1734526: <code>OgException: OG membership can not be created in entity

webchick’s picture

Status: Closed (works as designed) » Closed (fixed)

Just stumbled over this myself today; thanks for the helpful instructions IronWorker!

scottalan’s picture

Sinan Erdem,

I'm experiencing what you describe in #13...Did you get this sorted out?

Sinan Erdem’s picture

scottalan, unfortunately i didnt.

mohit_aghera’s picture

IronWorker,

Thanks for such description.
I am creating subgroups for the group. I have created a content type called 'group'.
I am curious whether can i use same content type for subgroup as well.

If i use the same content type will there be any problem with the groups functionality ?

maxchock’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev

I've follow suggestion on #6 but whenever I add the field for Group Audience, it will automatically checked the content type to Group content. Since #6 is quite aged, is it possible the new OG subgroup are different now? By the way i'm using version 2.x dev..

juan_g’s picture

[Deprecated, see an improved procedure in next comment #20]

I've follow suggestion on #6 but whenever I add the field for Group Audience, it will automatically checked the content type to Group content.

Yes, both "Group" and "Group content" should be checked for the Subgroup content type, and only "Group" for the Group content type (top level groups). From an interesting article:

"Any type of entity can belong to a group. In fact, the group entities themselves can also be designated as potential content for other groups. If set up this way we could have groups that contain other groups, creating subgroups."
Organic Groups for Drupal 7 | Lullabot

I am curious whether can i use same content type for subgroup as well.

No, I tried it, but according to my tests two content types are needed: The default Group (which can't have a parent) and a new Subgroup (which must have a parent). A very quick procedure, updating the previous one in comment #6, is as follows:

We add a new "Subgroup" content type, cloning the "Group" content type that comes with Organic Groups in e.g. Drupal Commons.

The module Bundle Copy 7.x-2.x-dev adds a new "CLONE" tab (and also "EXPORT" and "IMPORT") to:

Administration > Structure > Content types

In the CLONE tab:

Source Bundle:
  Group

New Bundle Name:
  Subgroup

And click in "Clone".

The new content type is created, almost exactly like the original, excepting of course the name "Subgroup" and the machine name "subgroup".

We add our planned change, in:

Administration > Structure > Content types > Subgroup > Edit > Organic Groups

checking "Group content", in addition to "Group", so that a new "Groups audience" field for parent group is automatically created.

And we change the content type description to "Group within another group."

That's all, excepting one very small glitch in:

Administration > Structure > Content types > Subgroup > Edit > Comment settings > Default comment setting for new content

The original was "Hidden" and the copy "Open". Just this one difference, very easy to correct.

All the rest of the content type, the many settings in Edit, Manage Fields, Manage Display, Comment Fields, Comment Display, Panelizer... everything is perfectly cloned.

We can verify:

Administration > Configuration > Organic groups > OG field settings

Subgroup already has the fields "Group", "Group roles and permissions" (like the Group content type), and also "Groups audience" (for parent group).

And we create our groups and subgroups:

Administration > Content > + Add content

All this is done with just Organic Groups. The module Subgroups for Organic groups adds more functionality. As Amitaibu said time ago:

"Subgroups are possible in OG7, but in order to propagate content/ users OG_subgroups7 should be used"
#824016: Subgroup visibility and access inheritance

juan_g’s picture

Testing more, the previous procedure has a problem, at least for the Drupal Commons distribution (which uses Organic Groups). There are many things in Commons already assigned to organic groups, and not to the new Subgroup type, such as breadcrumbs, blocks for recent activity, group contributors, etc. Everything is ready for the default type, so it's much better to use just one content type for all the published groups, the default "Group" type.

In this improved solution, the two content types needed for a tree of groups are:

  • The default "Group" type (slightly modified so it must have a parent) for all the groups excepting the root one.
  • And a new cloned "Site" type (which can't have a parent) for just that one unpublished top level root group.

As said, the module Bundle Copy 7.x-2.x-dev adds a new "CLONE" tab (and also "EXPORT" and "IMPORT") to:

Administration > Structure > Content types > CLONE

We add a new "Site" content type for Organic Groups, cloning the default "Group" content type. In the CLONE tab:

Source Bundle:
  Group

New Bundle Name:
  Site

And click in "Clone".

The new content type is created, almost exactly like the original, excepting of course the name "Site" and the machine name "site".

We also change the content type description to, for example, "Unpublished root of the group tree."

All the rest of the content type, the many settings in Edit, Manage Fields, Manage Display, Comment Fields, Comment Display, Panelizer... everything is cloned, excepting for some minor differences, very easy to correct in:

Administration > Structure > Content types > Site > Edit

Anyway, those minor differences are not important for an unpublished group. A new simple group type without cloning, even with different fields, etc., could be enough for the root. However, cloning opens the option of publishing this top level group as well, if we want it later.

So, the new "Site" type is ready.

Now, we modify the default "Group" type a little bit to accept parents:

Administration > Structure > Content types > Group > Edit > Organic Groups

We check "Group content", in addition to "Group", so that a new "Groups audience" field for parent group is created.

We can verify it:

Administration > Configuration > Organic groups > OG field settings

Group has already the fields "Group", "Group roles and permissions" (like the cloned Site content type), and now also "Groups audience" (for parent group).

And we create our tree of groups:

Administration > Content > + Add content

First we make an unpublished root group with the new Site type, e.g. with the name of our site, and then a tree with all the published groups, with the default Group type, that accepts parents in the added "Groups audience" field.

Now all published groups in the tree have the same full feature set.

juan_g’s picture

Issue summary: View changes
Status: Closed (fixed) » Needs review
juan_g’s picture

Note: If later Organic Groups (or Drupal Commons?) is patched so that groups can leave the "Groups audience" (parent) field optionally empty to be the top level groups, then the hidden root group could be removed.

juan_g’s picture

Update: I've just verified that the need for a hidden root for the tree of groups is a current Drupal Commons issue. Testing plain Organic Groups without Commons, we can easily create groups with or without parent using the same content type for all groups, in all tree levels.

If you don't have a test site with plain OG right now, you can quickly try it online at http://simplytest.me/

On the other hand, for Drupal Commons with OG, if there is an empty "Groups audience" (parent) field, that is to say for top tree level without parent, Commons doesn't allow it, saying:

Please enter one more groups where this content will be posted.

Probably there is some workaround, but it's not clear yet.

The main Drupal Commons issue about this problem is:

#2020061: Allow users to create content outside of groups

So, the procedure to create subgroups is much simpler for plain Organic Groups and, when that issue is solved, also for Drupal Commons.

In those cases, no need to clone, only one content type is needed. You can create it for plain OG, but if you already have a "Group" content type, just modify it to optionally have a parent, as follows:

Administration > Structure > Content types > Group > Edit > Organic Groups

We check "Group content", in addition to "Group", so that a new "Groups audience" field for optional parent group is automatically created.

And we create our tree of groups:

Administration > Content > + Add content

Now all groups in the tree have the same full feature set.

And this is it... for Organic Groups, and also hopefully soon for Drupal Commons.

juan_g’s picture

Another workaround I've tested, not needed for OG, only for DC until the issue is fixed (it seems that mostly fixed already in dev, and probably in the next stable DC release):

When creating top level groups, the hidden parent explained in comment #20 can be created, with the other group content type (e.g. Site), just for a minute, and deleted immediately, when the new top level groups are ready. In my test, the result is the same as the issue being fixed.

rakesh.gectcr’s picture

Is the #6 is the working Solution ?

How to create the sub group?

rakesh.gectcr’s picture

#6 is working...

in Drupal 7 og provides to inherit from another group. Which is not there in the Drupal 6.

aswani’s picture

Hi every one,
I have created a group and assign owner to it and later log in as created group owner and create sub group and assign another owner to it.
Now log in as child group owner for child group owner parent group name as well as child group name also displayed.
But i need to display both groups names to be displayed only for Parent group owner and
only child group name alone to be displayed for child group owner.

Is it possible to do like this by using drupal commons.If anyone knows answer please explain me in step by step process Please

kaizerking’s picture

I am getting this error when saving the a an item 'diatrict 1'

EntityMetadataWrapperException: Unknown data property field_og_subscribe_settings. in EntityStructureWrapper->getPropertyInfo() (line 335 of /home/aapkiaaw/public_html/theindianbugle.in/profiles/commons/modules/contrib/entity/includes/entity.wrapper.inc).

marty.true’s picture

A lot of this thread was kind of hijacked for Drupal Commons which is a custom distro, therefore much of what is contained in this thread is irrelevant to the actual question... How do you properly setup subgroups in D7, with a proper tree and with chained permissions?

I have been able to create a group that has group content so in theory, I can assign the (sub) group to another group's audience. But how do the permissions work and how does the tree get built?

juan_g’s picture

@xstatic: The procedure to create subgroups is almost the same for Organic Groups and for the mentioned Commons distro, since it's based on OG.

Steps to do this on Organic Groups were described in comment #6 and simplified in comment #23.

The tree is built by assigning the parent group of each subgroup, using the "Groups audience" field that is enabled in those steps.

As I mentioned in Drupal Answers, the Organic Groups module natively includes subgroup functionality since its Drupal 7 version. However, optionally, the Subgroups for Organic Groups module adds content and membership propagation.

Other optional modules that work with OG subgroups are for example Views tree (to display a now collapsible tree of groups), Crumbs (supporting subgroups in breadcrumbs)...

aguchoca’s picture

Ironworker made my DAY, good instructions!

mpotter’s picture

Priority: Major » Normal
Status: Needs review » Fixed

A) Not sure why this was re-opened and set to "needs review" when there isn't any patch here.

B) Support requests should never be "Major".

Looks like the instructions were provided and the request was solved.

Status: Fixed » Closed (fixed)

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