menuitem 1
menuitem 1.1
menuitem 1.2
menuitem 1.2.1
menuitem 2
menuitem 3

Now i have:

<?php $active = JFactory::getApplication()->getMenu()->getActive();?>
<body class="<?php echo $active->alias; ?> ">

And So I load your body class in the active food selection. I would like that to stay. The one thing I want would be to hide certain menu item's when for instance menuitem 1 is active. Then when that occurs I have to assign a category to menuitem 2.

This way after i navigate lower 1.1 it keeps recption menus products hidden.

Found an answer:

$menu =& JSite::getMenu();
$active = $menu->getActive();
$class = extractpath($active->route);
function extractpath($string){
return $m[0];

  <body<?php if ($class) echo ' class="' . $class . '"'; ?>>

To obtain the ID from the parent - $menu->getActive()->parent

To obtain the Title from the parent - $menu->getItem([id])->name