Only render icons of root navigation items

The upcoming navigation dashboard creates its links from the menu items in configuration.php.
Now, we encourage users to specify icons for second-level menu items but do not want render them in our menu.
This commit is contained in:
Eric Lippmann 2017-11-20 13:43:54 +01:00
parent 3660606ca1
commit 21dbe4ec47
1 changed files with 3 additions and 0 deletions

View File

@ -162,6 +162,9 @@ class RecursiveNavigationRenderer extends RecursiveIteratorIterator implements N
foreach ($this as $item) {
/** @var NavigationItem $item */
if ($item->shouldRender()) {
if ($this->getDepth() > 0) {
$item->setIcon(null);
}
if ($this->getUseStandardItemRenderer()) {
$renderer = new NavigationItemRenderer();
$content = $renderer->render($item);