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 am trying to combine Advanced Menu's submenu module with the superfish module.
So far I have managed to do it by overriding the theme_superfish function and calling an alter function right after the menu has been loaded with menu_tree_all_data(), but I would much rather avoid overridding the whole theme function.
Therefore I'm proposing a drupal_alter call in the theme_superfish function right after the menu has been loaded.
I will upload a patch that demonstrates the change.
Let me know if you'd like to see more about how I use this hook..
Comment | File | Size | Author |
---|---|---|---|
#1 | add_hook_to_alter_menu-2445841-0.patch | 385 bytes | prinds |
Comments
Comment #1
prinds CreditAttribution: prinds commentedComment #2
Rudi Teschner CreditAttribution: Rudi Teschner commentedThe advanced_menu_submenu module intends to integrate superfish, but it seems that aint working at all lately.
advanced_menu_submenu even causes an fatal error with superfish 2.x since the superfish_contents function used in advanced_menu_submenu_block_view_alter has not been included in the superfish 2.x branch.
Shouldnt this issue be adressed in the advanced_menu project instead? What could be causing this beheaviour?
Couldnt it suffice to change the order in which both modules alter the menu? At the moment it seems that superfish goes first and advanced_menu_submenu cant handle the result.
Comment #3
Nigel CunninghamI've just done the same thing. The problem is that advanced_menu can't replace the placeholder menu without the hook - if we attempt to do so in the 2 hooks Superfish does provide, it's too late in the game and the classes etc that should be there aren't there.
Given that I've come up with exactly the same solution, I'll mark this as RTBC.
Comment #5
mehrpadin CreditAttribution: mehrpadin commentedHey,
Thanks.