Welcome, Guest. Please login or register.
Did you miss your activation email?
February 13, 2012, 01:17:45 AM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
149700 Posts in 21103 Topics by 7538 Members
Latest Member: ionline
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: show_menu2 in WB7 and hidden pages  (Read 671 times)
spida

Offline Offline

Posts: 203


« on: March 08, 2010, 04:58:49 PM »

Hi there,

I am currently stuck with show_menu2. My client want to expand their website from one language to two languages. OK, no problem so far. But we have a main and a sub navigation in the website. Now, with the second language the structure looks like this:

- DE
-- de page 1
-- de page 2
-- de subcat 1
--- de subcat page 2
--- de subcat page 3

- EN
-- en page 1
-- en page 2
-- en subcat 1
--- en subcat page 2
--- en subcat page 3

The subcategories are hidden pages in order to prevent them from showing up in the main menu. The pages of the subcategories are displayed in a second menu.

* hope this makes sense to you so far *

I used the following code to display the second menu with show_menu2:
Code:
show_menu2(0,38,SM2_ALL,SM2_ALL,'[li]<a href="[url]" title="[menu_title]">[menu_title]</a>');
(38 is the page-id of de-subcat 1, see structure above please)

Having a second language and needing the same second menu too, I have to discard the page id. I tried quite a number of code according to the http://www.websitebakers.de/sm2/media/README.en.txt but wasn't successful. For example, using the following code nothing is shown in the menu although I thought I have to call the second level.
Code:
show_menu2(0,SM2_ROOT+1,SM2_CURR,false,'[li]<a href="[url]" title="[menu_title]">[menu_title]</a>');
It doesn't work with the third level either:
Code:
show_menu2(0,SM2_ROOT+2,SM2_CURR,false,'[li]<a href="[url]" title="[menu_title]">[menu_title]</a>');

Your help is very appreciated. Current live version of the website (with just one language still) is here: http://www.kompetenzia-international.com


Cheers
spida


« Last Edit: March 08, 2010, 05:28:54 PM by spida » Logged
Ruud
Board member
WebsiteBaker Org e.V.

Offline Offline

Posts: 2094



WWW
« Reply #1 on: March 10, 2010, 10:39:09 AM »

You could try something like this in your template:

Code:
<?php
if (LANGUAGE == 'DE') {
show_menu2(0,38,SM2_ALL,SM2_ALL,'[li]<a href="[url]" title="[menu_title]">[menu_title]</a>');
} elseif (
LANGUAGE == 'EN') {
show_menu2(0,xxx,SM2_ALL,SM2_ALL,'[li]<a href="[url]" title="[menu_title]">[menu_title]</a>');
} else {
show_menu2(0,yyy,SM2_ALL,SM2_ALL,'[li]<a href="[url]" title="[menu_title]">[menu_title]</a>');
}
?>

(use the correct values for xxx and yyy)

This way you can use a different starting point for each language.
Note: You will need to set the correct language in the pages for this to work. (You should anyway)
 
Logged

Professional WebsiteBaker Developer
spida

Offline Offline

Posts: 203


« Reply #2 on: March 11, 2010, 11:13:03 PM »

Hoi Ruud,

precies! That's it!

Best regards
spida
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!