show_menu2 help

mviens

#7
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

vyni

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:

<?php
if (LANGUAGE == 'EN') {
show_menu2(1,SM2_ROOT,SM2_ALL,SM2_ALL,'<li><a h.......>) ';
} else {
show_menu2(2,SM2_ROOT,SM2_ALL,SM2_ALL,'<li><a h.......>) ';
}
?>



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

regards from Himberg, next to Vienna

mviens

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

brofield

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

o_nantes

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 ?

show_menu2(2, 76, SM2_ALL, SM2_TRIM);


Regards Bernd

BerndJM

Hi,

you need a "auto" trim, why don't use SM2_TRIM ?

show_menu2(2, 76, SM2_ALL, SM2_TRIM);


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

o_nantes

#1
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