Menu help?

nibz


Roych

Quote from: nibz on July 24, 2015, 05:05:32 PM
This should work:


<div class="mainmenu pull-left">
<?php show_menu2(
        
$aMenu          1,
        
$aStart         SM2_ROOT,
        
$aMaxLevel      SM2_ALL,
        
$aOptions       SM2_ALL|SM2_PRETTY,
        
$aItemOpen      '<li><a  href="[url]" class="[class] [if(id==current||parent){active}]">[menu_title][if(class==menu-expand){<i class="fa fa-angle-down"></i>}]</a>',
        
$aItemClose     '</li>',
        
$aMenuOpen      '<ul role="menu" class="sub-menu">',
        
$aMenuClose     '</ul>',
        
$aTopItemOpen   false,
        
$aTopMenuOpen   '<ul class="nav navbar-nav collapse navbar-collapse">',
        
$aTopMenuOpen   false,
        
$alastbutton   true
); ?>

<>


Again a little note for you, $alastbutton is not part of  show_menu2. If you didn't adapt show_menu2 then you can leave this out.

Kind regards,
Nibz


OMG, that was fast, it's working perfect, only had to add +1 as it is multilanguage site.


For a "$alastbutton" you are right I copied the code from one of my older sites as it was similar. I will try to remember that.  (Y)

Thank you very much, saved me from hours if not days here...


R




nibz

This should work:


<div class="mainmenu pull-left">
<?php show_menu2(
        
$aMenu          1,
        
$aStart         SM2_ROOT,
        
$aMaxLevel      SM2_ALL,
        
$aOptions       SM2_ALL|SM2_PRETTY,
        
$aItemOpen      '<li><a  href="[url]" class="[class] [if(id==current||parent){active}]">[menu_title][if(class==menu-expand){<i class="fa fa-angle-down"></i>}]</a>',
        
$aItemClose     '</li>',
        
$aMenuOpen      '<ul role="menu" class="sub-menu">',
        
$aMenuClose     '</ul>',
        
$aTopItemOpen   false,
        
$aTopMenuOpen   '<ul class="nav navbar-nav collapse navbar-collapse">',
        
$aTopMenuOpen   false,
        
$alastbutton   true
); ?>

</div>


Again a little note for you, $alastbutton is not part of  show_menu2. If you didn't adapt show_menu2 then you can leave this out.

Kind regards,
Nibz

Roych

Hello, I'm having trouble implementig a menu on a site I'm working on, somehow won't work as it should and would need some help, please.
Im struggling with this for hours, can't see what's wrong.  :|



Here is the HTML code:
<div class="mainmenu pull-left">
                     

<ul class="nav navbar-nav collapse navbar-collapse">
<li><a href="index.html" class="active">Home</a></li>
<li class="dropdown"><a href="#">Shop<i class="fa fa-angle-down"></i></a>
                                    <ul role="menu" class="sub-menu">
                                        <li><a href="shop.html">Products</a></li>
<li><a href="product-details.html">Product Details</a></li>
<li><a href="checkout.html">Checkout</a></li>
<li><a href="cart.html">Cart</a></li>
<li><a href="login.html">Login</a></li>
                                    </ul>
                                </li>
<li class="dropdown"><a href="#">Blog<i class="fa fa-angle-down"></i></a>
                                    <ul role="menu" class="sub-menu">
                                        <li><a href="blog.html">Blog List</a></li>
<li><a href="blog-single.html">Blog Single</a></li>
                                    </ul>
                                </li>
<li><a href="404.html">404</a></li>
<li><a href="contact-us.html">Contact</a></li>
</ul>
<> <>



I tried with;
<?php show_menu2(
        
$aMenu          1,
        
$aStart         SM2_ROOT+1,
        
$aMaxLevel      SM2_ALL,
        
$aOptions       SM2_ALL|SM2_PRETTY,
        
$aItemOpen      '   <li class="dropdown">[a][menu_title]</a><i class="fa fa-angle-down"></i></a>      ',
        
$aItemClose     '</li>',
        
$aMenuOpen      '<ul role="menu" class="sub-menu">',
        
$aMenuClose     '</ul>',
        
$aTopItemOpen   false,
      
$aTopMenuOpen   '<ul class="nav navbar-nav collapse navbar-collapse">',
        
$aTopMenuOpen   false,
        
$alastbutton   true
); ?>



But it wont work, I must be doing something wrong here ...  :|


Any idea?


Thank you very much


R