WebsiteBaker Support (2.8.x) > Templates, Menus & Design

ShowMenu2: Bootstrap Navigation

<< < (6/9) > >>

nibz:
From here i don't know. Do you have a link to a demo page?

zirzy:

--- Quote from: nibz on December 21, 2015, 07:30:07 PM ---From here i don't know. Do you have a link to a demo page?

--- End quote ---

Sorry, but I do not have a link on this page  :-( I'am only testing this on my localhost, just to be sure it works with no flaws.. But I'm gonna use it if possible on my new project. I have made a few sites for bootstrap 3 but I have been using a different responsive navigation. It works fine on multilevel but there is a few flaws and for bootstrap it would be nice to have its own navigation ;) It is ok if there is max level thing. I can create another menu for + 2 etc. levels.

Maybe this has the same problem: http://WebsiteBaker.at/wb-templates/template-bs_naturak.html

$aMaxLevel      = SM2_CURR+1, -> If I change 1 to 2 or 3, menu disappears.. Why?

So if someone can help me with this I would appreciate it :) And maybe others will need this too ;)


zirzy



nibz:
Hi Zirzy,

You are right, i see the problem; when there are more levels the links with the > dont work.
I think this has something to do with the JS but don't know.
Tomorrow or tonight i will have some time to take a look.
I will report back.

Kind regards,

Nibz

nibz:
Hi zirzy,

This will fix the problem:

--- Code: ---<nav class="navbar navbar-default" role="navigation">
<?php 
$open = '<li class="[if(class=menu-current||class=menu-parent){active}] [if(class==menu-expand){dropdown}]">
[if(class==menu-expand&&level==0){<a href="[url]" class="dropdown-toggle" data-toggle="dropdown">[menu_title] <b class="caret"></b></a>}else {<a href="[url]">[menu_title]</a>}]';
show_menu2(
$aMenu          = 1,
$aStart         = SM2_ROOT, 
$aMaxLevel      = SM2_START+1,
$aOptions       = SM2_ALL,
$aItemOpen      = $open,
$aItemClose     = '</li>',
$aMenuOpen      = '<ul class="[if(level==0){nav navbar-nav}] [if(level==1){dropdown-menu}]">',
$aMenuClose     = '</ul>',
$aTopItemOpen   = false,
$aTopMenuOpen   = false
);?>
</nav>

--- End code ---

i added a conditional format option the ul wrapper, now only level 1 (root is level 0) will have the class dropdown-menu. Also i added a conditional format option to the menu-expand it will only search the root items and add the arrow icon to them (since if the link isn't at the root it will not work with a icon.)

Kind regards,

Robin

zirzy:
Ok, thanks for fast reply :)

Option 1
Here is what i have (all links works fine but dropdown desapears):


<?php
$open = '<li class="[if(class=menu-current||class=menu-parent){active}] [if(class==menu-expand){dropdown}]">[if(class==menu-expand&&level==0){<a href="" class="dropdown-toggle" data-toggle="dropdown">[menu_title] <b class="caret"></b></a>}else {<a href="">[menu_title]</a>}]';

show_menu2(
$aMenu          = 1,
$aStart         = SM2_ROOT+1,
$aMaxLevel      = SM2_START+1,
$aOptions       = SM2_ALL,
$aItemOpen      = $open,
$aItemClose     = '</li>',
$aMenuOpen      = '<ul class="[if(level==1){nav navbar-nav}] [if(level==2){dropdown-menu}]">',
$aMenuClose     = '</ul>',
$aTopItemOpen   = false,
$aTopMenuOpen   = false
);
?>


Option 2
..and like this (links with "arrow down" is referring nowhere and dropdown is working nicely ):


<?php
$open = '<li class="[if(class=menu-current||class=menu-parent){active}] [if(class==menu-expand){dropdown}]">[if(class==menu-expand&&level==1){<a href="" class="dropdown-toggle" data-toggle="dropdown">[menu_title] <b class="caret"></b></a>}else {<a href="">[menu_title]</a>}]';

show_menu2(
$aMenu          = 1,
$aStart         = SM2_ROOT+1,
$aMaxLevel      = SM2_START+1,
$aOptions       = SM2_ALL,
$aItemOpen      = $open,
$aItemClose     = '</li>',
$aMenuOpen      = '<ul class="[if(level==1){nav navbar-nav}] [if(level==2){dropdown-menu}]">',
$aMenuClose     = '</ul>',
$aTopItemOpen   = false,
$aTopMenuOpen   = false
);
?>


What is wrong?  :|

-Zirzy

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version