I had just assumed that og forums would carry with them the theme provided by the group. Unfortunately, this doesn't seem to be the case. I had to add this case for forums to the og.module's og_theme function:

// forums were not adopting groups theme when reviewing the list of topics
elseif (arg(0) == 'forum' && is_numeric(arg(1))) {
$pattern = '/(en\/forums\/)(.*)\/(.*)/';
$replace = 'group/$2';
$group_path = preg_replace($pattern, $replace, request_uri());
$group_nid = drupal_lookup_path('source', str_replace('/group','group',$grou
p_path));
$group_node = og_set_theme(str_replace('node/', '', $group_nid));
}

There must be a neater way to do this, but it works for now. This must be a problem others have struggled with.

Mike

Comments

rconstantine’s picture

This will take looking into. Group themes should show up if the group context is set. So if you see the group context menu, you should be seeing the group theme. If that's not the case (and I've never really used group-specific themes myself) then it should be fixed, though I don't think your solution is necessarily the best way to do it. We'll see.

mgifford’s picture

Thanks rconstantine

Yeah, I do hope that there is a better solution, but this works for now.

Ran into it again with the 'Post new forum topic' link defaulting to elseif (empty($gid)) {//normal forum, not in group in theme_og_forum_display(). I

// gid wasn't being passed through, trying to force it here
if(empty($gid)) {
$pattern = '/(en\/forums\/)(.*)\/(.*)/';
$replace = 'group/$2';
$group_path = preg_replace($pattern, $replace, request_uri());
$gid = str_replace('node/', '', drupal_lookup_path('source', str_replace('/group','group',$group_path)));
}

That pulled in the right group id, but we've got several forums in one organic group so this matrix doesn't seem to work:
if (!empty($gid) && array_key_exists($gid, $user->og_groups))

The $gid of the group is 2500 and the forum has a gid of 2502, so I had to just make it available for everyone who can view the page.

I'm not sure if these problems are because we're using the dev version or not. Not sure how backward compatible OG Forum 5.x-2.x-dev (2007-Dec-18) is.

Mike

rconstantine’s picture

Are you using the forum_access module? Something doesn't seem right here. Could you list your environment and modules you are using?

Anonymous’s picture

@Ryan

If you use either the pushbutton or chameleon themes you lose the group theme for the following pages

1. Group Forums
2. Add Forum
3. Edit Forum

I'll look into this problem.

I tried another theme "andreas02" at random from drupal.org and noticed that it was not rendering the groups block even though the theme block was automatically configured correctly.

rconstantine’s picture

@Paul

Are there any pages that keep the theme? I'd start with a look at what differences between the page source there are in those cases, then backtrack to the php and theme files. I assume you are testing in a bare bones setup?

While on the subject of themes, in the three theme functions, perhaps it would be nice if we added more ids for the tags. If you have time.

I have no further insight here. I have not tried the themes you list, though I have tried others that work including my own from scratch and the Bealestreet theme.

Anonymous’s picture

Assigned: Unassigned »

@Ryan

.. yes & yes

ill take a look at this some more today

Anonymous’s picture

Status: Active » Postponed

@Ryan

I am postponing this feature request / bug for post D6 migration

Anonymous’s picture

Status: Postponed » Fixed

This issue is fixed in the "next" development release for 6.x . If this problem occurs on 5.x please reopen and ill look into it again

Anonymous’s picture

Assigned: » Unassigned
Anonymous’s picture

Status: Fixed » Closed (fixed)