Menu based on cssmenu
Posted: Fri Apr 17, 2020 3:05 am
Hello!
I've customized a Menu from cssmenu. It looks fine in the page and on hover the target shows up in the status bar of the browser. But when I click a link nothing happens. Other links out of the menu are working. Here is the code:
Thank you
I've customized a Menu from cssmenu. It looks fine in the page and on hover the target shows up in the status bar of the browser. But when I click a link nothing happens. Other links out of the menu are working. Here is the code:
Code: Select all
{* Ormed Menu *}
{* this template uses recursion, but not a smarty function. *}
{*
variables:
node: contains the current node.
aclass: is used to build a string containing class names given to the a tag if one is used
liclass: is used to build a string containing class names given to the li tag.
*}
{if !isset($depth)}{$depth=0}{/if}
{strip}
{if $depth == 0}
<nav class="nav-menu d-none d-lg-block">
<!--main-nav-start-->
<ul class="nav-inner">
{else}
<ul>
{/if}
{$depth=$depth+1}
{foreach $nodes as $node}
{* setup classes for the anchor and list item *}
{$liclass=[]}
{$aclass=[]}
{* the first child gets a special class *}
{*if $node@first && $node@total > 1}{$liclass[]='first_child'}{/if*}
{* the last child gets a special class *}
{*if $node@last && $node@total > 1}{$liclass[]='last_child'}{/if*}
{if $node->current}
{* this is the current page *}
{*$liclass[]="menuactive active"*}
{$liclass[]="active"}
{*$aclass[]="menuactive"*}
{/if}
{if $node->has_children}
{* this is a parent page *}
{*$liclass[]="menuparent drop-down"*}
{$liclass[]="drop-down"}
{*$aclass[]="menuparent"*}
{/if}
{if $depth == 1 && $node@iteration == 5}
<li class="nav-logo">
<a href="https://ordemdosmedicos.co.ao">
<img src="{uploads_url}/images/logo.svg" alt="Ordem dos Médicos de Angola" width="55px" alt="" class="img-fluid" />
</a>
</li>{*else*}{*$node->menutext*}
{/if}
{* build the menu item from the node *}
{if $node->type == 'sectionheader'}
<li class='{implode(' ',$liclass)}'><a{if count($aclass) > 0} class="{implode(' ',$aclass)}"{/if}><span class="sectionheader">{$node->menutext}</span></a>
{if isset($node->children)}
{include file=$smarty.template nodes=$node->children}
{/if}
</li>
{else if $node->type == 'separator'}
<li style="list-style-type: none;"><hr class="menu_separator"/></li>
{else}
{* regular item *}
<li class="{implode(' ',$liclass)}">
<a{if count($aclass) > 0} class="{implode(' ',$aclass)}"{/if} href="{$node->url}"{if $node->target ne ""} target="{$node->target}"{/if}><span>{$node->menutext}</span></a>
{if isset($node->children)}
{include file=$smarty.template nodes=$node->children}
{/if}
</li>
{/if}
{/foreach}
{$depth=$depth-1}
</ul>
{if $depth == 0}
</nav><!--main-nav-end-->
{/if}
{/strip}