WebsiteBaker Community Forum
WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started 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:
<?php show_menu2(1, SM2_ROOT+2, SM2_START+3, SM2_ALL|SM2_NUMCLASS, '[li][a][menu_title]</a>', '</li>', '[ul]', '</ul>', false, false); ?>
<?php show_menu2(2, SM2_ROOT+2, SM2_START+3, SM2_ALL|SM2_NUMCLASS, '[li][a][menu_title]</a>', '</li>', '[ul]', '</ul>', 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?
-
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
-
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 ...
-
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.
-
Hi everybody,
Now i've made a fresh install but I still have the same problem... This is my info.php:
<?php
$template_directory = 'liylr_home';
$template_name = 'Live in Your Living Room home';
$template_version = '1.0';
$template_platform = '2.8.x';
$template_author = 'Pieter Beulens';
$template_license = 'Closed source';
$template_description = 'Template for Live in Your Living Room';
$menu[1] = 'Activiteiten';
$menu[2] = 'Over ons';
$block[1] = 'Over LIYLR';
$block[2] = 'Recente optredens';
?>
These are my menu calls:
<nav id="nav_activiteiten">
<?php show_menu2(1, SM2_ROOT+2, SM2_START+3, SM2_ALL|SM2_NUMCLASS, '[li][a][menu_title]</a>', '</li>', '[ul]', '</ul>', false, false); ?>
</nav>
and
<nav id="nav_over_liylr">
<?php show_menu2(2, SM2_ROOT+2, SM2_START+3, SM2_ALL|SM2_NUMCLASS, '[li][a][menu_title]</a>', '</li>', '[ul]', '</ul>', 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.
-
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.
-
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)
-
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)
-
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.
-
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.