OG forums; no extra modules*
I figured a way to create per-organic group specified forums, with no extra modules needed*. You will, however, have to apply this patch. It gives Views more respect for the $group placeholder. I am not using the core Forum module, but would be interested to see if this worked with it.
I developed this because I was worried about my users understanding the OG Taxonomy or OG forum modules. With this, they only see a few extra text fields when defining their group, and a pull-down when creating their topics.
The breadcrumbs may need to be customized to your site.
Exports of all content types and views are attached.
Edit your group content type
Assuming you already have a content type established to function as a group, it needs a multiple-value text field called forums. This will allow the group owner to specify which forum categories to allow in the group. Values specified here will show up in the edit form of the forum content type.
Create your forum topic content type
I'm using a very simple content type called "topic". The important part is a text select widget called forum with the following allowed value code:
<?php
if (arg(0) == 'node') {
$values = array();
$group = og_get_group_context();
$node = node_load($group->nid);
foreach($node->field_forums as $value) {
$values[] = $value['value'];
}
}
return $values;
?>Create the primary forum view
This approach uses one view to do most of the heavy lifting. It pulls in much different content in the empty text than the actual view. The "id" of the forum being viewed is based off the values specified in the community content type. The empty text is a recursive call to the view itself with the second argument supplied for each possible forum type.
There is a bit of an argument hack in here which appends an "f" to the forum ID when passing the argument, and then removes that "f" when handling it. It seems that OG or views or something is ignoring arguments valued 0, which is the key for the first multiple text value field. The "f" gets them past whatever code is borking them, and then we take it back off.
Create the empty category forum view
This is a simple view that pulls current topic content which has not been assigned a category.
*You need CCK and Views. These are not really extra. Also, of course, organic groups.
| Attachment | Size |
|---|---|
| forum_type_spec.txt | 1.72 KB |
| community_type_spec.txt | 1.87 KB |
| group_forum_view.txt | 5.22 KB |
| group_forum_nosub_view.txt | 2.69 KB |


