diff --git a/blocktopmenu.php b/blocktopmenu.php index 8d9f0c4..ced55bb 100644 --- a/blocktopmenu.php +++ b/blocktopmenu.php @@ -554,7 +554,7 @@ class Blocktopmenu extends Module implements WidgetInterface if (count($cms)) { $root_node['children'][] = $this->makeNode([ 'type' => 'cms-page', - 'type' => 'cms-page-' . $id, + 'page_identifier' => 'cms-page-' . $id, 'label' => $cms[0]['meta_title'], 'url' => $cms[0]['link'] ]); @@ -1409,7 +1409,6 @@ class Blocktopmenu extends Module implements WidgetInterface } $page_identifier = $this->getCurrentPageIdentifier(); - // Mark the current page return $this->mapTree(function (array $node) use ($page_identifier) { $node['current'] = ($page_identifier === $node['page_identifier']); diff --git a/blocktopmenu.tpl b/blocktopmenu.tpl index 88ba14e..7e3aedf 100644 --- a/blocktopmenu.tpl +++ b/blocktopmenu.tpl @@ -1,21 +1,27 @@ {function name="menu" nodes=[] depth=0} - {if $nodes|count} - + {/if} + {/strip} {/function} -{menu nodes=$menu.children} +