Running Drupal 7 with OG 7.x-2.3 and OG Menu 7.x-3.0-rc4. I have added a view to a Group Menu that lists all content in the group. All I want is for the group menu block to display when the view is executed.

I have added code in hook_views_pre_view to maintain the group context when view is executed.

I also attempt to utilize OG URL Group Context Detection by creating this URL path for the view:


I also added code in the view header/footer to detect if there is a group context when view executes. There is.

Despite all this, I can not get the Group menu block to display when the view is executed. Does anyone know of a way to accomplish this?

1 Answer 1


Resolved my issue, more or less, here: https://www.drupal.org/node/2195889#comment-8493709

  1. First, setting all group views to use this url format: group/%/(title)
  2. Always set group context in hook_views_pre_view() when arg(0) == 'group' and arg(1) is numeric. 3 .Use hook_block_info() to create my own block.
  3. Use hook_block_view() to make my block content equal that generated by og_menu_block_view().
  4. Go into block settings, and set the block to only appear on views = group/%/(title).
  5. Set the block to appear at the same weight (just above or below) as the OG Menu block.

And, voila! When I click on view from OG Menu, the OG group menu itself persists.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.