If I have two menus:
[A] B C
[1] 2 3
and [A] is selected with default [1]
If I select [2] it should be:
[A] B C
1 [2] 3
But instead [A] is not highlighted.
Using this type of notation:
<nav:render group="main-menu" />
<nav:renderSubItems group="main-menu"/>
(If I used <nav:render group="main-menu" submenu="true"/> it shows all of them . . . .not ideal)
To fix in NavigationTagLibrary.groovy I added an index:
// in eachItem (subItem is probably correct, but probably doesn't handle multiple levels):
iterateItems(items, var, body, attrs.params, activePath, 0)
protected iterateItems = { items, var, body, linkParams, activePath, index = -1 ->
. . .
if (index>=0) {
data.active = pathIsActive(item.path[index], activePath[index])
}
else{
data.active = pathIsActive(item.path, activePath)
}
If I have two menus:
[A] B C
[1] 2 3
and [A] is selected with default [1]
If I select [2] it should be:
[A] B C
1 [2] 3
But instead [A] is not highlighted.
Using this type of notation:
<nav:render group="main-menu" />
<nav:renderSubItems group="main-menu"/>
(If I used <nav:render group="main-menu" submenu="true"/> it shows all of them . . . .not ideal)
To fix in NavigationTagLibrary.groovy I added an index:
// in eachItem (subItem is probably correct, but probably doesn't handle multiple levels):
. . .