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_...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

swim’s picture

I think this will work.

swim’s picture

Status: Active » Needs review
FileSize
9.27 KB

Ugh, Flexnav sets the active class itself. Moving active trail from PHP to JavaScript to conform with Flexnav behavior.

darvanen’s picture

Status: Needs review » Reviewed & tested by the community

Looks 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.

darvanen’s picture

Status: Reviewed & tested by the community » Needs work
FileSize
55.02 KB

Actually, on second inspection there appears to be a problem:

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).

darvanen’s picture

FileSize
24.9 KB

Ok 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.

darvanen’s picture

Assigned: swim » darvanen
Status: Needs work » Needs review
FileSize
24.95 KB

Right, 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.

darvanen’s picture

Assigned: darvanen » Unassigned

Unassigning as I'm not currently working on this. Happy to update patch as needed.

jenlampton’s picture

Status: Needs review » Fixed
FileSize
9.69 KB

Great work here. The patch needed a slight re roll for some reason, but I'm going to commit as attached here.

  • jenlampton committed 7a3b162 on 7.x-1.x
    Issue #2286779 by Darvanen, swim, jenlampton: Allow for infinite nested...
jay-dee-ess’s picture

Status: Fixed » Needs work

The 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"

darvanen’s picture

Good point, fixing it here will likely help this issue too:

Make compatible with Menu Trail by Path