2 menus within one site?

johnbroeckaert

yeap....

thanks again!

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

Gast


johnbroeckaert

Thank you Uwe.

Very usefull! and indead very simple.
Thank again

Gast

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:
$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
<?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
Quoteshow_menu2(2, SM2_ROOT,

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

johnbroeckaert

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?

Gast

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(1SM2_CURR+1SM2_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(2SM2_ROOTSM2_ALLSM2_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(1SM2_CURRSM2_ALLSM2_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

Ruud

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.
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

johnbroeckaert


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