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!
Comment | File | Size | Author |
---|---|---|---|
#2 | menu_block-prevent_menu_mini_panel_block_title-2545706.patch | 565 bytes | jenlampton |
Comments
Comment #2
jenlamptonI'm attaching my current hack to remove the mini panel magic from menu blocks.
Comment #3
jenlamptonPatch still applies cleanly to 7.x-2.8.
Comment #5
joelpittetHey @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.Comment #6
jenlampton@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.Comment #7
howdytom CreditAttribution: howdytom as a volunteer commentedAny solution on this?