Is there anyway to use this module with the menu_block module?

I would like to be able to create a menu_block block using the "OG Menu: single."

This would allow me to create a limited depth menu_block to be used as a dropdown menu for each group. To do this currently, you would have to create a menu_block block for each group on your site.

What do you think?

Comments

gmclelland’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev

Just curious if anyone thinks this is possible? Menu Block does provide an api.

gmclelland’s picture

Well, as a start I added this to og_menu.module:

/**
 * Implements hook_menu_block_get_menus() from the menu_block.module
 */
function og_menu_menu_block_get_menus() {
  $menus = array();
  // For each menu, add the following information:
  $menus['og_single_menu_block'] = 'OG Menu : single';
  $menus['og_multi_menu_block'] = 'OG Menu : multiple';

  return $menus;
}

This allows the OG Menu : single and OG Menu : multiple to show up when adding a Menu Block, but after I configured a menu block using OG Menu : single, it showed up on the block admin page but nothing displayed when I placed the block into a region.

Back to the drawing board. I'm trying to do all of this because I don't want the OG Menu : single and OG Menu : multiple menu items to break my layout. I need to use Menu Block to limit the depth of the menu items that are displayed.

pontus_nilsson’s picture

As I see it what hook_menu_block_get_menus() does is to tell menu block about additional menus. But there is no menu called og_single_menu_block or og_multi_menu_block. I'll post back with my findings.

gmclelland’s picture

That explains why it doesn't work. Thanks for explaining that. I'm not sure how to work around this?

rv0’s picture

Status: Active » Postponed

No clue about this either.

gmclelland’s picture

For anyone who is interested I noticed http://drupal.org/project/domain_menu_block is similar to og_menu. Domain Menu Block provides a menu_block per domain, og_menu provides a block/s per group. Perhaps there is some ideas that can be used from that project.

Maybe og_single_menu_block or og_multi_menu_block could be replaced with a generated menu_block like Domain Menu Block does?

Any thoughts?

rv0’s picture

looks very cool

will check it out and push it to dev if its worthwhile

rv0’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev

Perhaps something to look at in 3.x

rv0’s picture

mccrodp’s picture

Here's a sandbox project for integrating with menu block for a particular use case.

  • One OG Menu per Group
  • The first group in a group audience field within a node is the og context
  • Fallback when no context is available is to iterate back through the path to get the og context from the nearest node

It may not help many directly but provides an indication on how you might go about this in a custom module in your own project for now.