mh, not quite sure what you mean...
Now only children highlighted and not parent.
a parent gets also active, see example below (reload the screenshot, now it's with a mouse pointer):
pages: name(slug)
- pagetitle1(pageone)
→ pagetitle2(pageone/pagetwo)
→ pagetitle3(pageone/pagethree)
default menu: name(link,branch)
pagetitle1(pageone,menutest)
menutest menu: name(link,branch has to be empty - since only one level ...)
pagetitle1(pageone,)
pagetitle2(pageone/pagetwo,)
pagetitle3(pageone/pagethree,)
is it possible to leave only parent with class='active', but not children?
if you want to have only the parent active, try this mod (it's the part above the code you posted):
$item['descripton'] = Html::toText($item['description']);
$pos = strpos($item['link'], 'http://');
if ($pos === false) {
$link = Option::get('siteurl').$item['link'];
} else {
$link = $item['link'];
}
if (isset($uri[0]) && $uri[0] !== '') {
if (in_array($item['link'], $uri) && trim($item['branch']) !== '') {
$anchor_active = ' class="current" ';
$li_active = ' class="active"';
}
} else {
if ($defpage == trim($item['link'])) {
$anchor_active = ' class="current" ';
$li_active = ' class="active"';
}
}
if (trim($item['target']) !== '') {
$target = ' target="'.$item['target'].'" ';
}
// get the default category