- Status changed to Needs work
almost 2 years ago 3:03pm 31 January 2023 - heddn Nicaragua
NW for some minor feedback in the MR. But this is looking good.
- Status changed to Needs review
almost 2 years ago 12:01am 22 February 2023 - heddn Nicaragua
Do the features in β¨ Integrate some of Menu Block module's options Fixed solve things here?
- Status changed to Needs work
28 days ago 3:23pm 20 November 2024 - πΊπ¦Ukraine Anna D
It seems merged advanced options in https://www.drupal.org/project/group_content_menu/issues/3366930 β¨ Integrate some of Menu Block module's options Fixed do same thing:
Added 'follow_parent' attribute under this issue:
+ // If we're following the active trail and the active trail is deeper than + // the initial starting level, we update the level to match the active menu + // item's level in the menu. + if ($follow && count($parameters->activeTrail) > $level) { + $level = count($parameters->activeTrail); + $following = TRUE; + } + + if ($following && count($parameters->activeTrail) >= $level) { + // Active trail array is child-first. Reverse it, and pull the new menu + // root based on the parent of the configured start level. + $menu_trail_ids = array_reverse(array_values($parameters->activeTrail)); + $offset = ($follow_parent === 'active') ? 2 : 1; + $menu_root = $menu_trail_ids[$level - $offset]; + $parameters->setRoot($menu_root)->setMinDepth(1); + if ($depth > 0) { + $parameters->setMaxDepth(min($depth, $this->menuTree->maxDepth())); + } + }
Added 'relative_visibility' attribute in #3366930 β¨ Integrate some of Menu Block module's options Fixed :
+ $relative_visibility = $this->configuration['relative_visibility'] ?? FALSE; + // If we're following the active trail and the active trail is deeper than + // the initial starting level, we update the level to match the active menu + // item's level in the menu. + if ($relative_visibility && \count($parameters->activeTrail) > $level) { + $level = \count($parameters->activeTrail); + $menu_trail_ids = \array_reverse(\array_values($parameters->activeTrail)); + $menu_root = $menu_trail_ids[$level - 2]; + $parameters->setRoot($menu_root); + } + // When the depth is configured to zero, there is no depth limit. When depth // is non-zero, it indicates the number of levels that must be displayed. // Hence this is a relative depth that we must convert to an actual // (absolute) depth, that may never exceed the maximum depth. if ($depth > 0) { - $parameters->setMaxDepth(min($level + $depth - 1, $this->menuTree->maxDepth())); + $relative_depth = $relative_visibility ? $depth : $level + $depth - 1; + $parameters->setMaxDepth(\min($relative_depth, $this->menuTree->maxDepth())); }
This issue and #3366930 β¨ Integrate some of Menu Block module's options Fixed both concern providing additional attributes from 'MenuBlock.'
I'd vote to keep the same UI and avoid visual differences between editing Group Menus and Menus, but since it has already been merged, perhaps we can close this issue.
Thank you.