I have menu mini-panels for each top-level item in my navigation. I also have menu blocks in the footer of my site, one for each top-level item of my navigation. I am seeing a rendered mini-panel in the footer navigation (where I don't want one) as well as in the site navigation bar at the top (where I do want one).

The one in the menu block appears when I check the option for "Block title as link" because menu_block just drupal_render()s the menu link item (from menu_tree_build()) to get the title of the block. Since the mini_panel is added into the #options of the link item, of course it is passed into the menu block, and rendered in the block title.

I think we maybe need a drupal_alter() on the title as it's retrieved, so that modules that add things into #options can remove them again before menu block blindly renders everything in the menu link.

Also open to other ideas!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jenlampton created an issue. See original summary.

jenlampton’s picture

I'm attaching my current hack to remove the mini panel magic from menu blocks.

jenlampton’s picture

Version: 7.x-2.7 » 7.x-2.8
Status: Active » Needs review

Patch still applies cleanly to 7.x-2.8.

Status: Needs review » Needs work
joelpittet’s picture

Version: 7.x-2.8 » 7.x-2.x-dev
Status: Needs work » Needs review

Hey @jenlampton, which version of menu_minipanels are you using and what are the steps to reproduce? I have a site with menu_minipanels 1.x and menu_block so I maybe able to reproduce?

Ideally menu_minipanels would get the fix.

jenlampton’s picture

@joelpittet I am using 7.x-2.0-beta1 of menu_minipanels.

The site is https://mtc.ca.gov, for reference. When the menu (main menu) is displayed in the header, it is using menu minipanels. The problem occurs when that same menu (main menu) is used in a sidebar block using menu_block (showing the parent item), or in the fat footer using menu_block, as this site is doing.

If menu_block would consider adding a drupal_alter() on what's getting rendered there, I'd be happy to write another patch that adds the alter hook into menu_minipanels.

howdytom’s picture

Any solution on this?