WebsiteBaker Support (2.8.x) > Templates, Menus & Design
[SOLVED] Multiple menus problem
pieterb:
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: ---<?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); ?>
--- End code ---
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?
pcwacht:
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
snark:
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 ...
pieterb:
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.
pieterb:
Hi everybody,
Now i've made a fresh install but I still have the same problem... This is my info.php:
--- Code: ---<?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';
?>
--- End code ---
These are my menu calls:
--- Code: ---<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>
--- End code ---
and
--- Code: ---<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>
--- End code ---
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.
Navigation
[0] Message Index
[#] Next page
Go to full version