I'm creating a custom menu for a project built in Drupal 7 and I want to add some custom HTML before every UL in the main menu.
By adding the THEMENAME_menu_tree__main_menu($variables) function to my template.php I can output my custom HTML:
return '<div>My custom HTML</div><ul class="main-menu">' . $variables['tree'] . '</ul>';
The function is called for every level in the menu and the HTML printed in front of every UL. But now I also want to customize this HTML in different ways for each level, but I cannot find any information regarding the current menu level in the $variables parameter.
Is it at all possible to access information about current menu level in the body of the function? If so, how?