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.
We need to recursively render out each menu tree; similar to https://api.drupal.org/api/drupal/includes!menu.inc/function/menu_tree_o...
While we don't need all that jazz some of those classes would also be helpful for themers & the like. This also gives us a chance to provide our own theme wrapper; Flexnav uses the most parent UL agghhh. This is slightly more difficult to change in Drupal RE https://api.drupal.org/api/drupal/includes!menu.inc/function/theme_menu_...
Comment | File | Size | Author |
---|---|---|---|
#8 | flexnav-2286779-allow-infinite-children-7.patch | 9.69 KB | jenlampton |
#6 | flexnav-2286779-allow-infinite-children-6.patch | 24.95 KB | darvanen |
Comments
Comment #1
swim CreditAttribution: swim commentedI think this will work.
Comment #2
swim CreditAttribution: swim commentedUgh, Flexnav sets the active class itself. Moving active trail from PHP to JavaScript to conform with Flexnav behavior.
Comment #3
darvanenLooks good to me, did exactly what I expected: allowed me to go an extra level deeper into the menu.
Installed on a reasonably complex site using Omega 4 for theme, no issues.
Comment #4
darvanenActually, on second inspection there appears to be a problem:
Full text:
Warning: Missing argument 2 for flexnav_menu_tree_output(), called in /var/www/drupal-7.34/sites/www/modules/flexnav/flexnav.module on line 322 and defined in flexnav_menu_tree_output() (line 292 of /var/www/drupal-7.34/sites/www/modules/flexnav/flexnav.module).
Comment #5
darvanenOk so I've edited one line in one whole hour and I have to leave this for today. I put a default value on $attributes in the function header for flexnav_menu_tree_output() because the parameter wasn't being sent at the recursion.
Now Drupal is telling me:
Notice: Undefined index: #below in theme_menu_link() (line 1629 of /var/www/drupal-7.34/includes/menu.inc).
However I noticed this was the case with the original patch too, not the current dev release though.
Comment #6
darvanenRight, all errors are dealt with. It turns out the system was expecting empty arrays in #below rather than for the array to not exist at all.
Comment #7
darvanenUnassigning as I'm not currently working on this. Happy to update patch as needed.
Comment #8
jenlamptonGreat work here. The patch needed a slight re roll for some reason, but I'm going to commit as attached here.
Comment #10
jay-dee-ess CreditAttribution: jay-dee-ess commentedThe active class isn't working properly. Multiple items may be considered active if there is any overlap with a parent menu item.
e.g. If "/about" and "/product" are two items in the menu each is active for the path "/product/about"
Comment #11
darvanenGood point, fixing it here will likely help this issue too:
Make compatible with Menu Trail by Path