WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: c0de on March 13, 2010, 08:57:10 PM

Title: show actual Level
Post by: c0de on March 13, 2010, 08:57:10 PM
Hey there again!

I fot the menu i need in this Thread:
https://forum.WebsiteBaker.org/index.php/topic,17511.0.html

This Question is something really else, but comes from the same problem, so i hope a new thread is ok.

I have this Struktur:
- Root Page
-- Subpage 1
-- Subpage 2

Now (with some big Help) i get to show Root Page + Subpages in one Menu when i clicked the Root page

The Next Problem is i need to know the Level where i am at the Moment, couse when i now get to "Subpage 1" the Root Page link is not shown any more in the Menu, so i think i need something like that:
Code: [Select]
if ($level = 1){
 show_menu(1);
} else {
 show_menu(2);
}

Or is there any nicer way to do that?

Thx
greetz
Title: Re: show actual Level
Post by: c0de on March 14, 2010, 12:48:37 AM
ok...

now counting the "/"
Code: [Select]
substr_count($_SERVER['SCRIPT_NAME'], '/')
Not fine but works...