First of all, I'v been using CMSMS for years now, this week I installed version 2.1.6 and I really like the improvements and new features, thanks everybody for the development.
Now I have a little problem, I'm trying to get this beautiful menu to work: https://www.smartmenus.org
As far as I can understand it, all this menu needs html-wise is a simple unordered list where the very first <ul> has its own id and class, like this:
Code: Select all
<ul id="main-menu" class="sm sm-blue">
<li><a href="#">Link1</a></li>
<li><a href="#">Link2</a>
<ul>
<li><a href="#">Child1 of Link2</a></li>
<li><a href="#">Child2 of Link2</a></li>
</ul>
</li>
</ul>
Code: Select all
{* simple navigation *}
{* note, function can only be defined once *}
{*
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.
*}
{function name=Nav_menu depth=1}
<ul id="main-menu" class="sm sm-blue">
{foreach $data as $node}
{if $node->current}
{* this is the current page *}
{assign var='aclass' value=$aclass|cat:'current'}
{/if}
{* build the menu item node *}
{if $node->type == 'sectionheader'}
<li class='sectionheader {$liclass}'><span>{$node->menutext}</span>
{if isset($node->children)}
{Nav_menu data=$node->children depth=$depth+1}
{/if}
</li>
{else if $node->type == 'separator'}
<li class='separator {$liclass}'><hr class='separator'/></li>
{else}
{* regular item *}
<li class="{$liclass}">
<a class="{$aclass}" href="{$node->url}"{if $node->target ne ""} target="{$node->target}"{/if}><span>{$node->menutext}</span></a>
{if isset($node->children)}
{Nav_menu data=$node->children depth=$depth+1}
{/if}
</li>
{/if}
{/foreach}
</ul>
{/function}
{if isset($nodes)}
{Nav_menu data=$nodes depth=0}
{/if}
Thanks in advance,
Kind regards,
Johan van Zanten