diff --git a/library/Icinga/Web/Navigation/Renderer/NavigationRenderer.php b/library/Icinga/Web/Navigation/Renderer/NavigationRenderer.php index ac7ee99c7..fb0ca0925 100644 --- a/library/Icinga/Web/Navigation/Renderer/NavigationRenderer.php +++ b/library/Icinga/Web/Navigation/Renderer/NavigationRenderer.php @@ -352,8 +352,9 @@ class NavigationRenderer implements RecursiveIterator, NavigationRendererInterfa foreach ($this as $item) { /** @var NavigationItem $item */ if ($item->shouldRender()) { + $content = $item->render(); $this->content[] = $this->beginItemMarkup($item); - $this->content[] = $item->render(); + $this->content[] = $content; $this->content[] = $this->endItemMarkup(); } } diff --git a/library/Icinga/Web/Navigation/Renderer/RecursiveNavigationRenderer.php b/library/Icinga/Web/Navigation/Renderer/RecursiveNavigationRenderer.php index 740df5602..d64ae3b27 100644 --- a/library/Icinga/Web/Navigation/Renderer/RecursiveNavigationRenderer.php +++ b/library/Icinga/Web/Navigation/Renderer/RecursiveNavigationRenderer.php @@ -162,14 +162,15 @@ class RecursiveNavigationRenderer extends RecursiveIteratorIterator implements N foreach ($this as $item) { /** @var NavigationItem $item */ if ($item->shouldRender()) { - $this->content[] = $this->getInnerIterator()->beginItemMarkup($item); - if ($this->getUseStandardItemRenderer()) { $renderer = new NavigationItemRenderer(); - $this->content[] = $renderer->render($item); + $content = $renderer->render($item); } else { - $this->content[] = $item->render(); + $content = $item->render(); } + $this->content[] = $this->getInnerIterator()->beginItemMarkup($item); + + $this->content[] = $content; if (! $item->hasChildren()) { $this->content[] = $this->getInnerIterator()->endItemMarkup();