WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: Roych on October 02, 2013, 06:06:57 PM

Title: Problem implementing a menu?
Post by: Roych on October 02, 2013, 06:06:57 PM
Hello,

Im having some problems implementing WB menu to my html template (it's live and wb ready) I tried almost anything that I could think of but Im not a coder so somehow I can't figure it out.

Wherever I put this id doesnt come up or it's not with css style.

I have a horizontal menu with couple submenus.

my html code looks like this:
Code: [Select]
<div class="nav-border">
              <div class="container">
                  <div class="navbar navbar_ clearfix row">
                     <div class="navbar-inner span12">                                                
                        <div class="nav-collapse nav-collapse_ collapse">
                          <ul class="nav sf-menu clearfix">
                            <li class="active"><a href="index.html">Main</a></li>
                            <li class="sub-menu"><a href="index-1.html">About</a>
                              <ul>
                                <li><a href="index.htm#">Studio</a></li>
                                <li><a href="index.htm#">Teachers</a></li>
                                <li><a href="index.htm#">Dance styles</a></li>
                                <li><a href="index.htm#">Schedule</a></li>
                                <li><a href="index.htm#">Competitions</a></li>
                                <li><a href="index.htm#">Gallery</a></li>
                              </ul>
                            </li>
                            <li><a href="index-2.html">Teachers</a></li>
                            <li><a href="index-3.html">Events</a></li>
                            <li><a href="index-4.html">Videos</a></li>
                            <li><a href="index-5.html">Presentation</a></li>
                            <li><a href="index-6.html">Contacts</a></li>
                          </ul>
                        </div>
                      </div>
                   </div>
                 </div>  
             </div>  


An I dont know where to put the WB code to make it work

I use this (IF THIS IS RIGHT AT ALL)

Code: [Select]
<?php show_menu2(
        
$aMenu          1,
        
$aStart         SM2_ROOT,
        
$aMaxLevel      SM2_ALL,
        
$aOptions       SM2_ALL|SM2_PRETTY,
        
$aItemOpen      '[li] [a][menu_title]</a>',
        
$aItemClose     '</li>',
        
$aMenuOpen      '<ul class="menu">',
        
$aMenuClose     '</ul>',
        
$aTopItemOpen   false,
        
$aTopMenuOpen   false
        
); ?>

Help needed please!

Roych
Title: Re: Problem implementing a menu?
Post by: nibz on October 02, 2013, 06:24:58 PM
Hi Roych,

Seems you are using Superfish menu.
This should work (untested):
Code: [Select]
<div class="nav-border">
<div class="container">
<div class="navbar-inner span12">
<div class="nav-collapse nav-collapse_ collapse">
<?php
show_menu2(
        $aMenu          1,
        $aStart         SM2_ROOT,
        $aMaxLevel      SM2_ALL,
        $aOptions       SM2_ALL|SM2_PRETTY,
        $aItemOpen      '<li class="[class] [if(class==menu-current){active}] [if(class==menu-expand){sub-menu}]">[a][menu_title]</a>',
        $aItemClose     '</li>',
        $aMenuOpen      '<ul>',
        $aMenuClose     '</ul>',
        $aTopItemOpen   false,
        $aTopMenuOpen   '<ul class="nav sf-menu clearfix">'
    );
?>

</div>
</div>
</div>
</div>

This is a replacement for the complete code you posted.
Title: Re: Problem implementing a menu?
Post by: Roych on October 02, 2013, 06:42:54 PM
You're the man its working now thank you very much.

I just had tu put back the
Code: [Select]
<ul class="nav sf-menu clearfix">cause some css displacement occured.

Just what I needed.

Thank you very, very much again ;)  :wink:

Roych
Title: Re: Problem implementing a menu?
Post by: nibz on October 02, 2013, 08:00:30 PM
Edited my code.

I put the code from aMenuOpen to aTopMenuOpen.
Now the topmenu opens with <ul class="nav sf-menu clearfix">
and the submenu's will open wit <ul>.