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.8 is now available!


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 »
  • show_menu2 help
  • Print
Pages: [1]   Go Down

Author Topic: show_menu2 help  (Read 6837 times)

o_nantes

  • Guest
show_menu2 help
« on: November 02, 2008, 12:24:30 PM »
Hi everybody,
I have a strange behavior with the use of show_menu2 : I can only display a full deployed  menu.
Explanations :
here's the website : http://www.drapes-aeriens.com
I use 2 languages FR and EN.
I have a second navigation bar on the left called by this fonction :

 show_menu2(2, 76, SM2_ALL, SM2_ALL);

Where :
2 is the menu number
76 the page id where begins the display of the menu (this page is hidden)

I tried all the possible options but the only way to display something else than a blank menu is :  SM2_ALL, SM2_ALL !!
And I need a "auto trim" menu (displaying the childs only where I'm on it)

So, I need a show_menu2 expert to stop my headhache :)
Thank you for your help

« Last Edit: November 02, 2008, 01:07:12 PM by o_nantes »
Logged

Offline BerndJM

  • Posts: 1764
  • Gender: Male
Re: show_menu2 help
« Reply #1 on: November 02, 2008, 05:17:02 PM »
Hi,

you need a "auto" trim, why don't use SM2_TRIM ?
Code: [Select]
show_menu2(2, 76, SM2_ALL, SM2_TRIM);

Regards Bernd
Logged
In theory, there is no difference between theory and practice. But, in practice, there is.

o_nantes

  • Guest
Re: show_menu2 help
« Reply #2 on: November 02, 2008, 06:07:56 PM »
Thank you Bernd for your reponse.
I tried that but it  doesn't work, in fact it works only if i'm already in one page of the sub menu (menu (2))  but when i call a page from the menu(1) the menu(2) doesn't display at all
I finally think it looks like a bug.

Quote from: BerndJM on November 02, 2008, 05:17:02 PM
Hi,

you need a "auto" trim, why don't use SM2_TRIM ?
Code: [Select]
show_menu2(2, 76, SM2_ALL, SM2_TRIM);

Regards Bernd
Logged

brofield

  • Guest
Re: show_menu2 help
« Reply #3 on: November 05, 2008, 11:09:26 AM »
Are you sure that you have configured the menus correctly? You appear to be using two different techniques at the same time: multiple menus (menu 2), and differently rooted menus (en and fr).

I have never seen a point in the multiple menu option (as implemented in WB2), I think that using differently rooted menus is the easier to understand way.
http://help.WebsiteBaker.org/pages/en/advanced-docu/designer-guide/multilingual-websites.php

Most likely this is a problem with your menu configuration. I would suggest changing to a single menu and using different roots.

Brodie
Logged

Offline mviens

  • Posts: 65
Re: show_menu2 help
« Reply #4 on: November 22, 2008, 02:25:57 AM »
I've read through a lot of the strings about multilingual sites and menus and haven't yet found an answer to my situation.

I have the following setup using:
show_menu2(0, SM2_ROOT+2, SM2_ALL, SM2_ALL|SM2_PRETTY, false, false, '<ul class="menu">'); ?>

Landing Page - with intro text in EN & FR and links to both languages:
- EN
-- Section 1
--- Section 1 sub A
--- Section 1 sub A
-- Section 2
--- Section 2 sub A
--- Section 2 sub A
- FR
-- Section 1
--- Section 1 sub A
--- Section 1 sub A
-- Section 2
--- Section 2 sub A
--- Section 2 sub A

But can't quite get the hang of Jellycan to show only/all the English pages/sub pages in the English section and likewise for the French.

I tried:
show_menu2(0, SM2_ROOT+2, SM2_ALL, SM2_TRIM
but then subpages didn't show up unless you clicked on the parent page.

Any help is always much appreciated.

Michael
Logged

vyni

  • Guest
Re: show_menu2 help
« Reply #5 on: November 22, 2008, 10:34:23 AM »
Hi, just an idea

You create 2 different menus. If You don“t know how look in the help-pages multiple menus.

One menu for EN-pages and one menu for FR-pages.
In Your index.php put an if-else switch, based on language, to the showmenu-call like this:

Code: [Select]
<?php
if (LANGUAGE == &#39;EN&#39;) {
show_menu2(1,SM2_ROOT,SM2_ALL,SM2_ALL,&#39;<li><a h.......>) &#39;;
} else {
show_menu2(2,SM2_ROOT,SM2_ALL,SM2_ALL,&#39;<li><a h.......>) &#39;;
}
?>


And from now You will only have either this or that menu.

regards from Himberg, next to Vienna
Logged

Offline mviens

  • Posts: 65
Re: show_menu2 help
« Reply #6 on: November 22, 2008, 11:02:34 PM »
Hi Vyni,

Thanks for the recommendation. After many hours of chasing my tale, I actually had a moment of clarity and reverted back to the initial setup I was first trying to do without all the extra coding. This time, I simply moved my EN and FR pages up to the root level next to Home:

HOME (Landing Page - with intro text in EN & FR and links to both languages):
EN
- Section 1
-- Section 1 sub A
-- Section 1 sub A
- Section 2
-- Section 2 sub A
-- Section 2 sub A
FR
- Section 1
-- Section 1 sub A
-- Section 1 sub A
- Section 2
-- Section 2 sub A
-- Section 2 sub A

and then set my menu call as follows:
<?php show_menu2(0, SM2_ROOT+1, SM2_ALL, SM2_ALL|SM2_CURRTREE|SM2_PRETTY, false, false, '<ul class="menu">'); ?>

And everything works just perfectly. I'm not sure why I didn't get this at the beginning but I guess it's all good learning...

Thanks again for your time.

Michael
« Last Edit: December 07, 2008, 05:51:47 AM by mviens »
Logged

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

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