19.11.2015 3668
In case you building a new template for CMS this is how you use the new menu builder invented in CMS 1.4.
All modern menus are based on lists, classes and sub classes. With CMS 1.4 it is super easy to use the automatic menu builder.
With one line of code your menu, sub menu, sub sub menu and so on up to five levels will be build automatically.
<?php echo jak_build_menu(0, $mheader, $page, 'nav nav-main navbar-nav navbar-right', 'dropdown', 'dropdown-menu', 'dropdown-submenu', false);?>
Let's pull apart the function.
This will produce a menu like this:
<ul class="nav nav-main navbar-nav navbar-right">
<li><a href="/">Home</a></li>
<li class="dropdown"><a href="/software">Software</a>
<ul class="dropdown-menu">
<li class="dropdown-submenu"><a href="/live-chat">Live Chat</a>
<ul class="dropdown-menu">
<li><a href="/compare">Compare</a></li>
<li><a href="/lc-websocket">WebSocket</a></li>
<li><a href="/lc-business">Business</a></li>
<li><a href="/lc-wordpress">WordPress</a></li>
<li><a href="/lc-light">Light</a></li>
</ul>
</li>
<li><a href="/cms">CMS</a></li>
<li><a href="/helpdesk">HelpDesk</a></li>
<li><a href="/dragdrop-shop">DragDrop Shop</a></li>
<li><a href="/feedback">Feedback</a></li>
</ul>
</li>
<li><a href="/pricing">Pricing</a></li>
<li><a href="/shop">Shop</a></li>
<li><a href="/demos">Demos</a></li>
<li><a href="/download">Download</a></li>
<li><a href="/blog">Blog</a></li>
<li><a href="/faq">FAQ</a></li>
<li><a href="/support">Support</a></li>
<li><a href="/hosting">Hosting</a></li>
<li><a href="/contact">Contact</a></li>
</ul>
Now it is just a mater of having the right classes to build the menu.