How to add body class that carries the menu depth of the current page? I am on Drupal 7. On the body tag, I need to create a new class that will detect the current page's menu depth. The class could carry the ID of the menu, then something that would detect the current page's menu depth. It could be something like: "primary-depth-0" for the top menu items, then "primary-depth-1", "primary-depth-2" and so forth... Is it easy to code that on template.php? I assume I have to add a new item into the $classes array...

Thank you.
I did something similar in the past, but I can't remember on which project, so I don't have working code.

Inside a template_preprocess_html, you get the breadcrumb via menu_get_active_breadcrumb.  You then walk the breadcrump  keeping track of depth, comparing the paths against the current path.  When you find a match, you end the walk and then

$variables['classes_array'][] = "menu-depth-" . $depth;


I am pretty sure this is what I did.