WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • [SOLVED] Multiple menus problem
  • Print
Pages: [1]   Go Down

Author Topic: [SOLVED] Multiple menus problem  (Read 6449 times)

Offline pieterb

  • Posts: 46
  • Gender: Male
[SOLVED] Multiple menus problem
« 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(1, SM2_ROOT+2, SM2_START+3, SM2_ALL|SM2_NUMCLASS, &#39;[li][a][menu_title]</a>&#39;, &#39;</li>&#39;, &#39;[ul]&#39;, &#39;</ul>&#39;, false, false); ?>
<?php show_menu2(2, SM2_ROOT+2, SM2_START+3, SM2_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?
« Last Edit: July 23, 2010, 10:59:29 AM by pieterb »
Logged

Offline pcwacht

  • Posts: 2923
  • Gender: Male
    • Dutch ICT info
Re: Multiple menus problem
« Reply #1 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
Logged
http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....

snark

  • Guest
Re: Multiple menus problem
« Reply #2 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 ...

Logged

Offline pieterb

  • Posts: 46
  • Gender: Male
Re: Multiple menus problem
« Reply #3 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.
Logged

Offline pieterb

  • Posts: 46
  • Gender: Male
Re: [SOLVED] Multiple menus problem
« Reply #4 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(1, SM2_ROOT+2, SM2_START+3, SM2_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(2, SM2_ROOT+2, SM2_START+3, SM2_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.
Logged

Offline DarkViper

  • Forum administrator
  • *****
  • Posts: 3087
  • Gender: Female
Re: Multiple menus problem
« Reply #5 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.
Logged
Der blaue Planet - er ist nicht unser Eigentum - wir haben ihn nur von unseren Nachkommen geliehen

"We need education to cope with digitalization - and NOT the digitalization of education.!"

Tägliches Stoßgebet: Oh Herr, wirf Hirn vom Himmel !

Offline pieterb

  • Posts: 46
  • Gender: Male
Re: Multiple menus problem
« Reply #6 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)
Logged

kirk

  • Guest
Re: Multiple menus problem
« Reply #7 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
Logged

Offline pieterb

  • Posts: 46
  • Gender: Male
Re: Multiple menus problem
« Reply #8 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.
Logged

Offline pieterb

  • Posts: 46
  • Gender: Male
Re: [SOLVED] Multiple menus problem
« Reply #9 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.
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • [SOLVED] Multiple menus problem
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2