diff --git a/src/Helper/Navigation/Menu.php b/src/Helper/Navigation/Menu.php index f3744ab51..63199b69c 100644 --- a/src/Helper/Navigation/Menu.php +++ b/src/Helper/Navigation/Menu.php @@ -270,18 +270,19 @@ protected function renderNormalMenu( ) { $html = ''; - // find deepest active - $found = $this->findActive($container, $minDepth, $maxDepth); - $escaper = $this->view->plugin('escapeHtmlAttr'); assert($escaper instanceof EscapeHtmlAttr); $foundPage = null; $foundDepth = 0; - if ($found) { - $foundPage = $found['page']; - $foundDepth = $found['depth']; + if ($onlyActive) { + // find deepest active + $found = $this->findActive($container, $minDepth, $maxDepth); + if ($found) { + $foundPage = $found['page']; + $foundDepth = $found['depth']; + } } // create iterator