Answer the question
In order to leave comments, you need to log in
How to set id and class to any menu level?
There are two menus: menu_block__1 and menu_block__2.
How can I manually set classes for each menu level?
For example:
first level ul - class "primary",
second level ul - class "secondary"
third level ul - class "last"
I tried these functions:
function THEME_menu_link(array $variables) {
global $_current_menu_depth;
$element = $variables['element'];
$_current_menu_depth = $element['#original_link']['depth'];
$sub_menu = '';
if ($element['#below']) {
$sub_menu = drupal_render($element['#below']);
}
$output = l($element['#title'], $element['#href'], $element['#localized_options']);
return '' . $output. $sub_menu . "\n";
}
function omega_shop_menu_tree($variables) {
global $_current_menu_depth;
return '';
- ' . $variables['tree'] . '
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question