Currently, if a group has multiple menus, the OG menu: single block displays the first menu only. If you are viewing group content that is linked from any other menu, you still only see the first menu and not the menu that contains the current content. I will submit a patch that checks if the current page is in any one of the group menus and display that menu in the single block, otherwise if none is found, display the first OG menu.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bulldozer2003’s picture

Status: Active » Needs review
Issue tags: +Needs committer feedback
FileSize
969 bytes
bulldozer2003’s picture

Would it be better to add a new display for this? Leaving single block to display the first menu and an additional block for the context aware menu?

In my use case I realize that a new context aware block would be better than replacing the single block.

bulldozer2003’s picture

Here is a patch implementing a new single menu block that shows the OG Menu the current page belongs to, if any.

Question: would it be worth adding code to check if the single menu block is in use and hide this block if it is going to show the single menu again?

bulldozer2003’s picture

Ok here is an even better implementation.

Now a "default" menu can be selected on the group>menus page, if set, that is the menu that the single menu block will display.

Adds the contextual single menu block, that will display the appropriate OG context's menu that has a link to the current page.

bulldozer2003’s picture

Title: Better single menu block display » Improved block display
FileSize
8.79 KB

Here is a fully thought out implementation of my improved block displays.

  • og menu single block
    • shows the "default" menu, or the first menu found
  • og menu context block
    • show the menu that contains a link to the current page, otherwise nothing
  • og menu multi block
    • displays the "default" menu at the top

To assign default menus, a new column was added to the group "list menus for %group" page. When og creates a menu for a group via the node checkbox, that menu is set default.

rv0’s picture

Status: Needs review » Needs work

Well, I could not apply to latest code so I just had a brief glance at the patch.
So correct me if I'm wrong:

The "og_menu_default_menus" variable setting puzzles me a bit.
I've worked on sites with 1000's of groups, that array will become huge.
This feels wrong. Would't a simple boolean in the og_menu table offer the same functionality at a fraction of the performance cost?

bulldozer2003’s picture

Rethinking this, I could change the menu list to be a sortable table and menus could be stacked in the order the user wants them displayed. Multi menu block would display them in the user defined order and single menu would display the top menu, while context menu block behaves as I originally outlined.

xjm’s picture

Issue summary: View changes
Issue tags: -Needs committer feedback