How to avoid Organic Groups menu tab Group

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by pelsdyret on February 20, 2013 at 6:09pm

Organic Group has added a [Group] tab menu item to all my nodes being viewed, including those which are not part of any group. I have various kind of content, and only one of them is a Group type.

Now every node on my site shows [View] [Group] at the top, where there used to be nothing, unless you were an editor.

How can I avoid this behaviour? Clicking on the [Group] shows a page with no information, since the content is not really connected to a group.

Thank you!

Comments

Are you means that only

Posted by yutaolife on April 5, 2013 at 3:17pm

Are you means that only "Group #1" content display under "Group #1"

Eh...?

Posted by pelsdyret on April 9, 2013 at 6:50am

I'm not really sure what you mean by that. The problem has to do with the primary menu tabs.

I have kind of solved it be removing the undesired tab:

<?php
>
/**
* Alters the menu tabs the following ways:
* - [Group] is removed for xxx groups
* - [Edit] is changed to [Edit Group] for xxx groups
* - [View] is not shown when active (in view mode)
* @param array $data
* @param $router_item
* @param $root_path
*/
function MYMODULE_menu_local_tasks_alter(&$data, $router_item, $root_path) {
if(empty(
$data['tabs'][0]['output'])) return;
global
$user;

$node = menu_get_object();
foreach(
$data['tabs'][0]['output'] as $key=>$tab) {
switch(
$tab['#link']['path']) {
case
'node/%/group' :
unset(
$data['tabs'][0]['output'][$key]);
$data['tabs'][0]['count']--;
break;
case
'node/%/edit' :
if(
_MYMODULE_is_editable_group($node)) {
$data['tabs'][0]['output'][$key]['#link']['title'] = t("Edit Group");
}
break;
case
'node/%/view' :
if(isset(
$tab['#active']) && $tab['#active'] == 1) {
unset(
$data['tabs'][0]['output'][$key]);
$data['tabs'][0]['count']--;
}
break;
}
}
}
?>

Tab Tammer Module

Posted by kclarkson on May 7, 2013 at 3:32pm

You could also use the Tab Tamer module to disable the tab.

http://drupal.org/project/tabtamer

Kaleem S. Clarkson
www.kaleemclarkson.com

OG Mass Add issue

Posted by josvl on September 10, 2013 at 4:42pm

I had this problem too, the Group tab appearing on all pages, not just those that are marked as Group.
I figured out that on my system this was caused by the Organic Groups Mass Add module.
See this issue: https://drupal.org/node/1912848 and this fix: https://drupal.org/node/1993918.

Also an OG Extra issue

Posted by nbennett_tag on July 24, 2014 at 7:57pm

Just found that the OG Extras (og_extras) module adds a 'Groups' link to the main menu in og_extras.views_default.inc.

Commented it out & the link in the main menu is gone.

Organic groups

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /