Various fixes
This commit is contained in:
+1
-2
@@ -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']);
|
||||
|
||||
+7
-1
@@ -1,9 +1,11 @@
|
||||
{function name="menu" nodes=[] depth=0}
|
||||
{strip}
|
||||
{if $nodes|count}
|
||||
<ul class="menu" data-depth="{$depth}">
|
||||
<ul data-depth="{$depth}">
|
||||
{foreach from=$nodes item=node}
|
||||
<li class="{$node.type}{if $node.current} current{/if}">
|
||||
<a href="{$node.url}" {if $node.open_in_new_window} target="_blank" {/if}>{$node.label}</a>
|
||||
<div>
|
||||
{menu nodes=$node.children depth=$node.depth}
|
||||
{if $node.image_urls|count}
|
||||
<div class="menu-images-container">
|
||||
@@ -12,10 +14,14 @@
|
||||
{/foreach}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
{/if}
|
||||
{/strip}
|
||||
{/function}
|
||||
|
||||
<div class="menu">
|
||||
{menu nodes=$menu.children}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user