Author Topic: Menu help?  (Read 1821 times)

Offline Roych

  • Betatester
  • **
  • Posts: 573
  • Gender: Male
Menu help?
« on: July 24, 2015, 04:33:55 PM »
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:
Code: [Select]
<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;
Code: [Select]
<?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

Offline nibz

  • Posts: 684
  • Gender: Male
Re: Menu help?
« Reply #1 on: July 24, 2015, 05:05:32 PM »
This should work:

Code: [Select]
<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

Offline Roych

  • Betatester
  • **
  • Posts: 573
  • Gender: Male
Re: Menu help?
« Reply #2 on: July 24, 2015, 05:09:44 PM »
This should work:

Code: [Select]
<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




Offline nibz

  • Posts: 684
  • Gender: Male
Re: Menu help?
« Reply #3 on: July 24, 2015, 05:11:17 PM »
You're welcome :).

 

postern-length