Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have a subnav using menu block and on some pages with children it will expand the menu to show the children, but on some it won't. From what I can tell, there is no reason or setting why it should work on some pages and not on others.
You can see the site here: drupal.mcgreevyprolab.com Look at Press Printing Services. Only one link will show its children. When I'm on the child page the menu is expanded.
Comments
Comment #1
museumboy CreditAttribution: museumboy commentedI figured this out: this module does not work correctly with Menu Trail by Path enabled.
Comment #2
mausolos CreditAttribution: mausolos commentedI actually am having a similar issue, but I don't have Menu Trail by Path on my system at all. My problem is that none of my child links are showing up at all, even though I've checked the various boxes in menu and the settings page for the menu block that should tell them to display expanded.
The modules I have enabled that might have anything to do with menus or blocks are:
admin_menu
admin_menu_toolbar
menu
menu_block
menu_block_export
borealis_sb (borealis module)
block
blockify
Comment #3
mausolos CreditAttribution: mausolos commentedThis appears that it may be an issue with the theme I'm using, Aurora. When switching to Bartik and getting the settings as close as possible relative to the theme, I was able to see the expanded menu.
Comment #4
snappermorgan CreditAttribution: snappermorgan commentedFor me, it was the Bootstrap 3.0 theme. I discovered that in one of its core include files it was only rendering the submenu with a depth of 1.
The file is bootstrap/theme/menu/menu-link.func.php. I added my own hook_menu_link override in my template.php file and removed the check on menu depth and all my submenus magically appeared.
Comment #5
modstore CreditAttribution: modstore commentedThanks for the feedback snappermorgan, I had the same exact issue.
Comment #6
skaduI can confirm snappermorgan and modstore's findings, Bootstrap 3 has an issue here.
Comment #7
Eric At NRD CreditAttribution: Eric At NRD commentedI struggled with this issue today. Fortunately, there is a simple fix for it:
https://www.drupal.org/node/1850194#comment-8551799
Comment #8
rcodina CreditAttribution: rcodina commentedThanks @snappermorgan for your suggestion. it works for me.
Comment #9
rcodina CreditAttribution: rcodina commentedComment #10
MrPeanut CreditAttribution: MrPeanut commented@snappermorgan — I'm having the same issue. Would you be able to share your overrides?
Comment #11
mrcdrx CreditAttribution: mrcdrx commentedI have the same problem. I have set a fixed parent menu item, and I want to show all children of that menu item. I've checked 'Expand all children of this tree', and set maximum depth to 'Unlimited'. When I'm logged in, the entire menu expands. However, when I'm viewing the site as a Anonymous user, only the first menu item with children expands, and the rest stays collapsed. I don't have Menu Trail by Path installed or enabled
Edit: Nevermind: some of nodes connected to the menu items had viewing access blocked by Content Access, so the menu-items weren't show. D'oh!
Comment #12
bhawanac CreditAttribution: bhawanac commentedI was facing the same problem with book navigation.
#4 Worked for me.
Thanx
Comment #13
bhawanac CreditAttribution: bhawanac at Cybage Software Pvt Ltd. commentedI was facing the same problem with book navigation.
And for that patch #4 worked for me.
Thanx!
Comment #14
Jabastin Arul CreditAttribution: Jabastin Arul commentedOnly "Bootstrap" theme has a problem. And #4 patch working perfectly
Comment #15
Jabastin Arul CreditAttribution: Jabastin Arul commentedPlease use this code:
function themename_menu_link__menu_block($variables) {
return theme_menu_link($variables);
}
Please put that code on template.php file
Comment #16
cptnobvious CreditAttribution: cptnobvious commentedI'm using the bootstrap theme and also wasn't seeing any sub-submenu items (depth 2) rendered when using menu_block
Adding this to my template.php fixed it. It's mostly code from menu-link.func.php with an extra else statement to catch things with a greater depth than 1. Hope it helps someone.
Comment #17
luciano.baraglia CreditAttribution: luciano.baraglia as a volunteer commented#16 is the only that worked for me...thanks dude... (great username BTW)
Comment #18
Jabastin Arul CreditAttribution: Jabastin Arul commentedComment #19
Vasantha Raja CreditAttribution: Vasantha Raja commented#15 worked like a charm.