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.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


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.10.x) »
  • General Help & Support »
  • 2 menus within one site?
  • Print
Pages: [1]   Go Down

Author Topic: 2 menus within one site?  (Read 15424 times)

johnbroeckaert

  • Guest
2 menus within one site?
« on: January 19, 2018, 10:48:37 AM »

Is there by chance a description available that explains how to put 2 menus in your template?
and the possibility to choise witch page in witch menu appears?
wb 2.10 - php 7.x

THANKS
Logged

Offline Ruud

  • Posts: 3671
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: 2 menus within one site?
« Reply #1 on: January 19, 2018, 11:23:27 AM »
The old helppages are more or less still valid.

https://help.WebsiteBaker.org/en/help/designerguide/multiplemenus.php

For the show_menu() calls described in that page you might want to use the good old show_menu2() functions.
The first parameter in show_menu2() is the $menu[] to be used.
Logged
Dev4me - WebsiteBaker modules - WBhelp.org

Offline jacobi22

  • Betatester
  • **
  • Posts: 5920
Re: 2 menus within one site?
« Reply #2 on: January 19, 2018, 11:29:29 AM »
same menu a second time or a complete different menu?


example for a submenu, that show only childs from the actual page inside of a sidebar

ob_start();
                
show_menu2(1, SM2_CURR+1, SM2_CURR+1, '', '<li class="[class]">[a][menu_title]</a></li>', '', '', '', '');
                
$childpages = ob_get_contents();
                
ob_end_clean();


or you work with menu-groups (only possible inside of a language tree)



ob_start
();
        
show_menu2(2, SM2_ROOT, SM2_ALL, SM2_ALL, '<li class="[class]"><a href="[url]" class="[class]"><span>[menu_title]</span></a>', "</li>", '<ul>', '</ul>', true, '<ul id="mobile2" class="headernav">');
        
$headermenu = ob_get_contents();
        
ob_end_clean();

        
ob_start();
        
show_menu2(1, SM2_CURR, SM2_ALL, SM2_ALL, '<li class="[class] p[page_id]"><a href="[url]" class="[class]"><span>[menu_title]</span></a>', "</li>", '<ul>', '</ul>', true, '<ul id="mobile" class="headernav">');
        
$submenu = ob_get_contents();
        
ob_end_clean();


maybe, you talk a little about the project, the pagestructure and the planned menu's
Logged

johnbroeckaert

  • Guest
Re: 2 menus within one site?
« Reply #3 on: January 19, 2018, 12:04:37 PM »
Thank you @Ruud for the "old" helpfiles.! I will into this.

@jacobi22
It is a bit difficult to tell about the project but I'll try.

it becomes a site for three languages and the intention is to have a number of pages fixed in a menu and the rest in a different menu. For example at the top of the page the pages: home - about us - contact
and under the header image the pages that are about the products / services that are delivered. (no webshop!)
Is this a bit clear?
Logged

Offline jacobi22

  • Betatester
  • **
  • Posts: 5920
Re: 2 menus within one site?
« Reply #4 on: January 19, 2018, 12:44:38 PM »
not so difficult to unterstand  ;-)

if you dont have it yet, you need a definition of multiple menus in your frontend-template info.php, the menu-groups....
examplecode:
Code: [Select]
$menu[1] =        'Mainmenu';
$menu[2] =        'Topbarmenu';
$menu[3] =        'Sidebarmenu';
$menu[4] =        'Footermenu';
$menu[5] =        'No Menu';

choose your own module-group-names. if you need more groups, build more groups, no limits ;-)

after every changing in info.php, you have to reload the templates in WB (Addons -> Advanced)

After that, go to the page Settings from every needed page and set there the menu group
remember: every page without a special menugroup are automatically in menu group 1, so before you start to change anything, all pages are in menu-group1

now change the menu-group for the pages in the top menu
for example: home - about us - contact

Use my second code example. these are the topmenu ($headermenu) and the mainmenu ($submenu)

Output of the menu with
Code: [Select]
<?php echo $headermenu; ?>where ever you need

in my code example, i use the menu-group-id == 2 for the top- or headermenu, use this ID in the menu-call
Quote
show_menu2(2, SM2_ROOT,

be sure, that you select also pages like this in other languages or this menu is empty
Logged

johnbroeckaert

  • Guest
Re: 2 menus within one site?
« Reply #5 on: January 19, 2018, 01:48:50 PM »
Thank you Uwe.

Very usefull! and indead very simple.
Thank again
Logged

Offline jacobi22

  • Betatester
  • **
  • Posts: 5920
Re: 2 menus within one site?
« Reply #6 on: January 24, 2018, 05:35:06 PM »
and???

works??   :wink:
Logged

johnbroeckaert

  • Guest
Re: 2 menus within one site?
« Reply #7 on: January 25, 2018, 08:01:00 AM »
yeap....

thanks again!

You 're doing a nice job here on the forum!  (Y) (Y)
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.10.x) »
  • General Help & Support »
  • 2 menus within one site?
 

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