By am22 on
Hi,
I just wondered if it wouldn't be too difficult to write a module, that shows a menu item for every existing organic group. It is the first time that I'm trying to write my own module, so it is just a first attempt.
// Parent menu item
$parent_id = 431;
function mymodule.menu {
foreach(<--og node-->) {
$items['<--path-->'] = array(
'title' => $node->title,
'description' => 'Your description goes here.',
'page callback' => '<--show node xy-->',
'menu_name' => NULL,
'tab_parent' => $parent_id,
'type' => MENU_NORMAL_ITEM,
);
}
return $items;
}
Is that basically how it could work? I didn't really find an explanation how to use the variables of hook_menu. Is there anything better than http://drupal.org/node/300997 ?