WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: mgeene on July 03, 2017, 12:16:54 PM

Title: Show_menu2 - menuitem niet laten zien
Post by: mgeene on July 03, 2017, 12:16:54 PM
Hallo,

Ik heb een show_menu2 navigatie in een website gebruikt, maar ik wil 1 menuitem niet zichtbaar hebben in de navigatie.
Ik kan alleen de pagina niet in de backend op "niet zichtbaar" zetten, omdat er veel pagina's onder hangen die in een ander menu weer zichtbaar moeten zijn. Is dit te doen met show_menu2 d.m.v. id of zo?

Alvast bedankt voor je reactie.
Title: Re: Show_menu2 - menuitem niet laten zien
Post by: Gast on July 03, 2017, 12:43:12 PM
without details....
solution 1: set page visibility to hidden
if you need on a other place a submenu with the child of this hiddenpage, use the page-id of this hidden page in the show-menu-call like this (43 is the page-id of your hidden page)

Code: [Select]
<?php show_menu2(043SM2_ALLSM2_ALL,'<li><span class="menu-default">[ac][menu_title]</a></span>','</li>','<ul>','</ul>');?>

solution 2 - multiple menus
ckeck the info.php of the used frontend-template for a definition like this
Code: [Select]
$menu[1]  = 'top-main-menu';
$menu[2]  = 'sibebar';
$menu[3]  = 'footer"';
$menu[99] = 'none';
you need there minimum two definitions, a hidden menu "none" not included
if you have there a definition like this with multiple menus, you can select a non-standard menu in the page settings of this page and this page will not show'n in the main menu

example for the submenu with a new menu-id (2)
Code: [Select]
<?php show_menu2(2SM2_ROOTSM2_ALLSM2_ALL,'<li><span class="menu-default">[ac][menu_title]</a></span>','</li>','<ul>','</ul>');?>
Title: Re: Show_menu2 - menuitem niet laten zien
Post by: Hans on July 03, 2017, 11:49:07 PM
Not tested, but 1. sounds good.

I'll give it a try, I had this same question  as #mgeene for a  long time but used something like 2. 1. Looks good to, even better.  (Y)


Title: Re: Show_menu2 - menuitem niet laten zien
Post by: Gast on July 04, 2017, 12:56:39 AM
additional tip for the work with multiple menu's (my solution 2)
example:

EN
--page EN 1
----Page EN 1.1
----Page EN 1.2

DE
--page DE 1
----Page DE 1.1
----Page DE 1.2

its not possible, to show parts of the english tree, if you stay on the DE-Pages (and vice versa). its not possible, to come out of this (language)-tree and show also parts of another (language)-tree. show_menu2 goes only downwards to the root parent of the called page with the same language like the called page. It is not suitable if you use several languages
multiple menus like my solution 2 works fine, if you show only pages with one languages in a submenu somewhere on the page and its better like solution 1, because solution 1 has a hard-coded Start-ID (43 in my example)

Solution 1 is a permanent menu, it show's the menu everytime (like a footer-menu), doesnt matter, which level and which parent. if you want to show the submenu only if you stay on the selected parent page, use SM2_CURR instead of the Page-ID.
to make solution 1 flexible for multilingual projects, you need a switch like this ( with a show-menu-call to a special Page-ID for every used language, here NL, DE and EN as System-Language - System-Language (or DEFAULT-LANGUAGE) is the Language in the WB-Settings and the Start-language, if you visit this project the first time without a language-select, because of that, the Default-Language stay in the else-part of this switch)

<?php
if (LANGUAGE=="NL") {
  show_menu2(0, 43, SM2_ALL, SM2_ALL,'<li><span class="menu-default">[ac][menu_title]</a></span>','</li>','<ul>','</ul>');
} elseif (LANGUAGE=="DE") {
  show_menu2(0, 99, SM2_ALL, SM2_ALL,'<li><span class="menu-default">[ac][menu_title]</a></span>','</li>','<ul>','</ul>');
} else (LANGUAGE=="EN") {
  show_menu2(0, 1, SM2_ALL, SM2_ALL,'<li><span class="menu-default">[ac][menu_title]</a></span>','</li>','<ul>','</ul>');
}
?>

See also the post from James here -> https://forum.WebsiteBaker.org/index.php/topic,29130.msg204929.html#msg204929
Title: Re: Show_menu2 - menuitem niet laten zien
Post by: mgeene on July 10, 2017, 01:11:38 PM
Thanks for your repley,
ik will take a look at it and let you know.