Here's a guide to the eternal theme: Multilingual site with several menus as I realized on my website. I'm content with it. Thanks to Hans for the translation.
www.micro-agentur.deThere is a horizontal main menu, a vertical menu for the SUBLEVEL of the main menu, and a footer menu. The aim is that the footer menu reflects the selected language. The language choice is not called with show_menu2 but coded in the template. But more on that later.
Requirement is a WB 2.7 installation with show_menu2
In the backend of WB you have to choose the option to have several menus.
Define an ID and a name for the second footer menu in the info.php of the template:
// Definition of the menu-elements (if more than one 1 menu is used)
$menu[1] = 'Mainnavigation';
$menu[2] = 'Footernavigation';
In index.php call the horizontal main navigation level1 this way:
<?php show_menu2(1, SM2_ROOT+1, SM2_START); ?>
For level 2 of the main navigation as I use on my site in a vertical form, use this code:
<?php show_menu2(1, SM2_ROOT+2, SM2_START); ?>
The Footer navigation is invoked as:
<?php // Submenu
show_menu2(2, $wb->page['root_parent'], SM2_ALL,
SM2_ALL | SM2_PRETTY); ?>
Now, in the backend a page tree can be created for each language. For example DE and EN.
Each language gets a home page that is realized as a "Menu Link" type. Each additional page in this branch (language) is a sub-level of the "Menu Link" page which we called DE and EN.
Important: The "Menu Link" pages must first be created so that the URL calls the correct language tree , in this case DE - Start
-DE (Main navigation root level)
- Start (Main navigation level 1 subpage of DE)
- GermanPage 1 (Main navigation level 2 subpage of Start)
- GermanPage 2 (Main navigation level 2 subpage of Start)
- GermanPage 3 (Main navigation level 2 subpage of Start)
-EN (Main navigation root level)
- Home (Main navigation level1 subpage of EN)
- EnglishPage 1 (Main navigation level 2 subpage of Home)
- EnglishPage 2 (Main navigation level 2 subpage of Home)
- EnglishPage 3 (Main navigation level 2 subpage of Home)
-Kontact (Footernavigation subpage of DE)
-Impressum (Footernavigation subpage of DE)
-Contact (Footernavigation subpage of EN)
-Disclaimer (Footernavigation subpage of EN)
Now we miss the menu to choose a language. That menu isn't called with a show_menu2 menu but coded in the index.php of the template with this code:
<a href="http://yourdomain/pages/de/start.php"><img src="<?php echo TEMPLATE_DIR; ?>/img/deflag.jpg" alt="DEUTSCH" border="0" /></a>
<a href="http://yourdomain/pages/en/home.php"><img src="<?php echo TEMPLATE_DIR; ?>/img/enflag.jpg" alt="ENGLISH" border="0" /></a>
The language associated flags are in the img folder of the template. Of course one can also choose to use pure text links.
That's it.
I had to bite myself a long time through the many posts on this topic and hope to help you with this little tutorial.
I'm not a coder and my guide is not an ultimate solution, but at least it works for me this way.
Kirk