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 in WB7 and hidden pages
  • Print
Pages: [1]   Go Down

Author Topic: show_menu2 in WB7 and hidden pages  (Read 5050 times)

spida

  • Guest
show_menu2 in WB7 and hidden pages
« 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: [Select]
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 Tutorial link removed 404 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: [Select]
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: [Select]
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: December 31, 2017, 04:02:31 PM by Luisehahne »
Logged

Offline Ruud

  • Posts: 3671
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: show_menu2 in WB7 and hidden pages
« Reply #1 on: March 10, 2010, 10:39:09 AM »
You could try something like this in your template:

Code: [Select]
<?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)
 
Admin Edit: fix code design
« Last Edit: December 31, 2017, 04:05:53 PM by jacobi22 »
Logged
Dev4me - WebsiteBaker modules - WBhelp.org

spida

  • Guest
Re: show_menu2 in WB7 and hidden pages
« Reply #2 on: March 11, 2010, 11:13:03 PM »
Hoi Ruud,

precies! That's it!

Best regards
spida
Logged

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

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