I've spotted something, which could be something that was overlooked by this module, or an issue with Menu block itself:

When a menu block has it's level set to 2 (to show sub items of a main nav only), and one of the 2nd level menu items is set to active using context, the menu stays hidden.

Standard behaviour should be to show the menu if it contains an active item, regardless of whether a page from that menu is being physically viewed - which leads me to think this is an issue with the Menu Block module.

Comments

kenianbei’s picture

I think if you set the menu block to 'Expand all children of this tree. ' it will fix this.

mvuijlst’s picture

...and if you don't want to expand all children? Is there any way to get around the issue?

Mark Trapp’s picture

Status: Active » Closed (duplicate)

There is no workaround. Menu Block does not populate the children of the menu unless it's checked, so the module can't traverse the menu tree to find the active menu item.

This is a duplicate of #1081840: Support for menu items past 1st level?.

mirie’s picture

Perhaps this would work?

If you expand all of the children and add some js (loaded via template.php maybe) to change the menu block appearance. For example,

(function($) {
  Drupal.behaviors.alterMenuBlock = function (context) {
    $(".block-menu_block:not(.alterMenuBlock-processed)", context).each(function () {
      $(this).addClass('alterMenuBlock-processed').find("ul.menu li.expanded").each(function(){
        if ( ! $(this).hasClass('active-trail') ) {
	  $(this).removeClass('expanded');
	  $(this).addClass('collapsed');
	  $(this).children().remove('ul.menu');
	}
      });	  
    }); 
  };	
})(jQuery);
jptaranto’s picture

Thanks Mirie, you're a champ :)

The JS code worked well & setting the expand option now shows the menu when stuff is set to active.