WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: pieterb on July 17, 2010, 01:25:19 PM

Title: [SOLVED] Multiple menus problem
Post by: pieterb on July 17, 2010, 01:25:19 PM
Hi everybody,

I've switched on use multiple menus in the settings, I've put the menus in my info.php and i've put menu items inside the menus. Thus far no problem. But, when I call show_menu2, only the first of my 2 menus is shown. I've used the following lines to show my menus:
Code: [Select]
<?php show_menu2(1SM2_ROOT+2SM2_START+3SM2_ALL|SM2_NUMCLASS, &#39;[li][a][menu_title]</a>&#39;, &#39;</li>&#39;, &#39;[ul]&#39;, &#39;</ul>&#39;, false, false); ?>
<?php show_menu2(2SM2_ROOT+2SM2_START+3SM2_ALL|SM2_NUMCLASS, &#39;[li][a][menu_title]</a>&#39;, &#39;</li>&#39;, &#39;[ul]&#39;, &#39;</ul>&#39;, false, false); ?>
So the first menu works perfectly, but the second one doesn't show up at all. I've also tried it with show_menu(2), but again no luck. When i use show_menu2(SM2_ALLMENU) it shows both menus. But when I enter show_menu2(0), only the first menu is shown. Very strange... Can someone put me in the right direction?
Title: Re: Multiple menus problem
Post by: pcwacht on July 17, 2010, 02:17:00 PM
in your templates info.php there are lines saying:
menu[1] = somemenu;
menu[2] = othermenu;

notice the 1 and 2, these are the menunumbers need using
with the shoiwmenu and showmenu2 calls.

for example:
menu[1] = somemenu;
menu[4] = othermenu;
the othermenu is called with showmenu(4)

Have fun,
John
Title: Re: Multiple menus problem
Post by: snark on July 17, 2010, 04:49:54 PM
in addition to that, you can also add a line in the info.php

menu[9] = do not show in any menu;

now with the menu-choice option in the page settings you can also choose
"do not show in any menu" as an option

since this refers to menu 9 which is not available it will not show up in any menu

seen the fact that almost no template will need 9 menus the menu[9] will result in the same functions as visibillity=hidden. I found out that some people think this is a more logical way of setting the page to not show up in the menu ...

Title: Re: Multiple menus problem
Post by: pieterb on July 19, 2010, 11:35:05 AM
Hi guys,

Thanks for the tips, but that wasn't the problem I was describing. I know how to create multiple menus and how to access them. The problem was that I did everything correctly, but the content simply didn't show up. The problem was caused by not creating the template first, zipping it and installing it, but I simply copied an existing template and started editing everything (including name, folder etc). I thought that a reload would fix everything, but it didn't. Now I've made a zip file of the template and installed it on a different WB installation and everything works.
Title: Re: [SOLVED] Multiple menus problem
Post by: pieterb on July 22, 2010, 10:24:31 PM
Hi everybody,

Now i've made a fresh install but I still have the same problem... This is my info.php:

Code: [Select]
<?php

$template_directory 
= &#39;liylr_home&#39;;
$template_name = &#39;Live in Your Living Room home&#39;;
$template_version = &#39;1.0&#39;;
$template_platform = &#39;2.8.x&#39;;
$template_author = &#39;Pieter Beulens&#39;;
$template_license = &#39;Closed source&#39;;
$template_description = &#39;Template for Live in Your Living Room&#39;;

$menu[1]    = &#39;Activiteiten&#39;;
$menu[2]    = &#39;Over ons&#39;;

$block[1] = &#39;Over LIYLR&#39;;
$block[2] = &#39;Recente optredens&#39;;

?>

These are my menu calls:
Code: [Select]
<nav id="nav_activiteiten">
  <?php show_menu2(1SM2_ROOT+2SM2_START+3SM2_ALL|SM2_NUMCLASS, &#39;[li][a][menu_title]</a>&#39;, &#39;</li>&#39;, &#39;[ul]&#39;, &#39;</ul>&#39;, false, false); ?>
</nav>
and
Code: [Select]
<nav id="nav_over_liylr">
  <?php show_menu2(2SM2_ROOT+2SM2_START+3SM2_ALL|SM2_NUMCLASS, &#39;[li][a][menu_title]</a>&#39;, &#39;</li>&#39;, &#39;[ul]&#39;, &#39;</ul>&#39;, false, false); ?>
</nav>
As you can see, the only difference in the menu calls is the menu number (1 or 2). I've also tried with the simple show_menu(#) call, but that also doesn't work.

I also get the message "Klik hier om naar de homepagina te gaan" (Click here to go to the homepage) in one of my blocks. Does anyone know where I'm going wrong? I'm hosting locally on Xampp.
Title: Re: Multiple menus problem
Post by: DarkViper on July 22, 2010, 10:40:31 PM
at first:
your info.php is ok
your SM2-calls are ok

but:
did you activate 'multiple menus' in Backend/ Options-extended ?
did you assign the menus to the pages? ( Page-Settings/Options)

without these settings multiple menus never will work.
Title: Re: Multiple menus problem
Post by: pieterb on July 22, 2010, 11:00:06 PM
Yes, I have set the right options in Settings page. And yes, I assigned different pages to different menus. My page structure is as follows:

NL
  Home
    Page 1 (menu 1)
    Page 2 (menu 1)
    Page 3 (menu 1)
    Page 4 (menu 1)
    Page 5 (menu 2)
    Page 6 (menu 2)
    Page 7 (menu 2)
    Page 8 (menu 2)
EN
  Home
    Page 1 (menu 1)
    Page 2 (menu 1)
    Page 3 (menu 1)
    Page 4 (menu 1)
    Page 5 (menu 2)
    Page 6 (menu 2)
    Page 7 (menu 2)
    Page 8 (menu 2)
Title: Re: Multiple menus problem
Post by: kirk on July 23, 2010, 12:45:13 AM
Please read this tutorial i made for several menus with several languages.

may this helpĀ“s

Kirk

https://forum.WebsiteBaker.org/index.php/topic,13577.msg83173.html#msg83173 (https://forum.WebsiteBaker.org/index.php/topic,13577.msg83173.html#msg83173)
Title: Re: Multiple menus problem
Post by: pieterb on July 23, 2010, 10:35:12 AM
Thanks for your help, but this isn't the problem: even when I simply say show_menu2(2), the menu doesn't show up, although it has been defined in the info.php.
Title: Re: [SOLVED] Multiple menus problem
Post by: pieterb on July 23, 2010, 11:00:57 AM
I've solved the problem: the structure of the pages must be like this:
NL (menu 1)
  Home (menu 1)
    Page 1 (menu 1)
    etc
NL (menu 2)
  Home (menu 2)
    Page 1 (menu 2)
    etc
EN (menu 1)
  Home (menu 1)
    Page 1 (menu 1)
    etc
EN (menu 2)
  Home (menu 2)
    Page 1 (menu 2)
    etc

Now everything works like a charm.