Hello Everybody!
Since I'm new to drupal, my following question/explanation might be not the best one. If this one was already discussed somwhere else please let me know.
Ok now to the topic:
I need to generate a class specifier in the body tag holding info about which level/depth the current/active.
Following implementation I've done to get to my goal, but I'm not shure if my path is the right one or if still miss something:
I used the garland theme to tweak.
In template.php I added a small helper function:
function helper_getMenueLevel() {
$level = 0;
$mid = menu_get_active_item();
while ($mid && ($item = menu_get_item($mid))) {
if ( ($item['type'] & (MENU_VISIBLE_IN_TREE | MENU_VISIBLE_IF_HAS_CHILDREN )) && (! ($item['type'] & MENU_IS_ROOT )))
$level++;
$mid = $item['pid'];
}
return $level;
}
further I added following code to phptemplate_body_class:
if (isset($class) ){ $class .= ' L'. helper_getMenueLevel(); }
else $class = 'L'. helper_getMenueLevel();
now the resulting body tag looks like :
<body class="L0">
where L0 means startpage, L1 means level/depth 1 and so forth.