Autonav submenu - don't display children but highlight parent

Permalink
Hi There,

I've been searching around for this but can't figure it out sorry.

I have a submenu that is displaying the pages I would like - parents at level two but no children.

However, when on a child page, how do you get the parent in the menu to highlight?

I've configured auto_nav using a stack in a global area and am using a custom template - does this sort of thing get configured in the block settings or the custom template?

Here is what the custom template looks like incase it's something in here:
<?php 
   defined('C5_EXECUTE') or die("Access Denied.");
   $bt->controller->displayPages = 'current';
   $aBlocks = $controller->generateNav();
   $c = Page::getCurrentPage();
   $nh = Loader::helper('navigation');
   $isFirst = true;
   foreach($aBlocks as $ni) {
      $_c = $ni->getCollectionObject();
      if (!$_c->getCollectionAttributeValue('exclude_nav')) {
         $target = $ni->getTarget();
         if ($target != '') {
            $target = 'target="' . $target . '"';
         }
         if ($ni->isActive($c) || strpos($c->getCollectionPath(), $_c->getCollectionPath()) === 0) {


Any pointers in the right direction would be much appreciated.

Cheers

Ben

 
mesuva replied on at Permalink Best Answer Reply
mesuva
I think your autonav template is missing the parts that would normally spit out 'nav-selected' and 'nav-path-selected' classes.

The default autonav template adds the 'nav-path-selected' class to the parent items of the current page and I'm fairly certain it doesn't matter if you have the children actually on the menu or not.

With that in place, you'll need to edit your theme's css to apply a style using that class.

I'd also recommend Jordan Lev's 'clean' autonav template, it's a great starting point with lots of easy to enable classes for styling control: https://github.com/jordanlev/c5_clean_block_templates/blob/master/au...
cmscss replied on at Permalink Reply
Sweet as, Jordan's template did the trick - that dude rules the school.
cmscss replied on at Permalink Reply
Diggin' his page_list template as well - thanks for the link.