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 site with a large menu using the nice menu module and I noticed nice menu loads the full menu tree regardless of the depth selected on the block.
Is there any reason that line 465 of nice_menus.module couldn't change from:
$menu = isset($menu) ? $menu : menu_tree_all_data($menu_name);
TO:
$menu = isset($menu) ? $menu : menu_tree_all_data($menu_name, NULL, ($depth + 1));
Or something similar so that it only loads the required depth?
Comment | File | Size | Author |
---|---|---|---|
#3 | nice_menus-depth-performance-2900987-3-7.patch | 743 bytes | jbabiak |
Comments
Comment #2
maseyuk CreditAttribution: maseyuk commentedComment #3
jbabiak CreditAttribution: jbabiak commentedFound this issue while trying to increase performance on site i'm working on that has a huge menu tree. I've tested this and found no negative effects and it does limit the depth that is loaded within theme_nice_menus_tree in nice_menus.module.
I've made the previous comments from maseyuk into a patch for the 7.x-3.x-dev branch.
Thanks maseyuk.
Comment #5
xiukun.zhou CreditAttribution: xiukun.zhou commentedfixd thanks
Comment #6
xiukun.zhou CreditAttribution: xiukun.zhou commented