WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.9 R22 is now available!


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • Show_Menu2 - everytime the same s*** :D
  • Print
Pages: [1]   Go Down

Author Topic: Show_Menu2 - everytime the same s*** :D  (Read 13489 times)

Offline neu1886

  • Posts: 10
Show_Menu2 - everytime the same s*** :D
« on: June 06, 2017, 01:12:11 AM »
Hi everyone,

today i have a simple question but i can't find a solution. I have a main menu which only shows the level 0 items (top level). Clear, every top level page could have n..* subpages. If a top level page is selected, i want an output (second menu) like this

Code: [Select]
HOME   NEWS   > EVENTS < (Main Menu)

--Menu 2--
EVENT 1
> EVENT 2 <

I use this code for Menu 2:

Code: [Select]
show_menu2(0, SM2_ROOT+1, SM2_START, SM2_ALL | SM2_PRETTY);
But if i select EVENT 1...EVENT 2 etc. the menu vanish. But i want to have the Menu for each Subpage of EVENTS. How to realize this?

Thanks and sorry for the bad english!
Logged

Offline dbs

  • Betatester
  • **
  • Posts: 8926
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: Show_Menu2 - everytime the same s*** :D
« Reply #1 on: June 06, 2017, 08:16:25 AM »
Hi, here my bad english answer ( there is also a german forum  :wink: ).
You should show us the show_menu2 codes for main menu and for the submenu.
Logged
https://onkel-franky.de

Offline neu1886

  • Posts: 10
Re: Show_Menu2 - everytime the same s*** :D
« Reply #2 on: June 06, 2017, 11:44:10 AM »
Code for the Main Menu:

Code: [Select]
$openItem = '<li[if(class=menu-current||class=menu-parent){ class="active"}]><a href="[url]"><span data-hover="Home">[menu_title]</span></a>';

show_menu2(
$aMenu          = 0,
$aStart         = SM2_ROOT,
$aMaxLevel      = SM2_START,
$aOptions       = SM2_ALL | SM_PRETTY,
$aItemOpen      = $openItem,
$aItemClose     = '</li>',
$aMenuOpen      = '<ul class="nav navbar-nav">',
$aMenuClose     = '</ul>',
$aTopItemOpen   = false,
$aTopMenuOpen   = false
)

Code for the Submenu:

Code: [Select]
function hasSubmenu() {
$childs = show_menu2(0, SM2_CURR+1, SM2_START, SM2_BUFFER|SM2_ALL|SM2_CURRTREE);
return (!empty($childs)) ? true : false;
}

if(hasSubmenu()) {
$menuItem = '<li[if(class=menu-current||class=menu-parent){ class="active"}]><a href="[url]"><i class="g-mr-10 fa tab__fa fa-arrow-right"></i> [menu_title]</a>';

show_menu2(
$aMenu          = 0,
$aStart         = SM2_ROOT+1,
$aMaxLevel      = SM2_START,
$aOptions       = SM2_ALL | SM_PRETTY,
$aItemOpen      = $menuItem,
$aItemClose     = '</li>',
$aMenuOpen      = '<ul class="nav nav-pills nav-stacked">',
$aMenuClose     = '</ul>',
$aTopItemOpen   = false,
$aTopMenuOpen   = false
);
}

It looks like hasSubmenu doesn't work correctly.  :-(
Logged

Offline dbs

  • Betatester
  • **
  • Posts: 8926
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: Show_Menu2 - everytime the same s*** :D
« Reply #3 on: June 06, 2017, 02:46:04 PM »
You can test in
Code: [Select]
if(hasSubmenu()) { ...
...
$aStart         = SM2_CURR+1,
Logged
https://onkel-franky.de

Offline dbs

  • Betatester
  • **
  • Posts: 8926
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: Show_Menu2 - everytime the same s*** :D
« Reply #4 on: June 06, 2017, 06:21:26 PM »
and look here
Code: [Select]
$aOptions       = SM2_ALL | SM_PRETTY,should be
Code: [Select]
$aOptions       = SM2_ALL | SM2_PRETTY,
Logged
https://onkel-franky.de

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • Show_Menu2 - everytime the same s*** :D
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2