Question

Wondered if someone can shed some light on OG groups in Drupal.

I know you can restrict what types of NODES that can be created within groups, but what if yuo have two types of groups. Can you restrict the creation of a certain type of node to only one group ?

Example: I allow users to create groups called Sports I allow uses to create groups called Movies

I have two types of nodes: Food & Shoes Can I set that the Food node, can only be created inside the movie group And set that the Shoes node can only be created inside the Sports group ?

thanks :)

Was it helpful?

Solution

Core behavior of OG is that every Content type defines it's own relationship to OG. They might be barred from a group relationship, a group node, or a group post. There is nothing in that base configuration to specify the relationship between a content type and each group type individually.

However, there are a few tricks you could put in place to try to facilitate something.

Cheap Trick

For example, if you hide the navigation to create a node of a given content type, you've cut off the obvious approach.

OG User Roles

Probably the most conventional trick I can think of would be to carve up the different content types on a permissions level. I'm not entirely positive this will work, so it will bear some experimentation.

  1. Create a Sports Writer role, limit the ability to create and edit Basketball nodes to it.
  2. Use OG User Role to automatically promote members of the Sports group types into the Sports Writer role.

Cutting Edge Shenanigans

You can also use the Spaces module to toggle content type availability by Feature. In fact, the implementation of spaces_menu_alter() might show you how you could programmatically build out the functionality you are looking for. Sounds like it would be useful.

OTHER TIPS

When you create a Shoe/Food node, there is a dropdown/select list to choose the group it gets added to, right?

It should be possible to write a module that implemented hook_form_alter to intercept the node form for the food and shoes node and do a lookup based on the node type to filter the groups made available to it.

edit This module seems to exist, it may do what you require: http://drupal.org/project/og_content_type_admin

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top