Separate 'quick menu'

Permalink
I have a site with a sidebar menu that is basically a 'Quickmenu' for end users to navigate to more important or useful pages of the site. I created an AutoNav template for this menu that pulls pages in if they're attribute 'Quickmenu' is checked.

The issue I've run into is when a quicklink needs to be added, but is a child of a parent page. Here is my view.php file for this menu:

<?php 
   defined('C5_EXECUTE') or die("Access Denied.");
   $aBlocks = $controller->generateNav();
   $c = Page::getCurrentPage();
   echo("<ul class=\"quicklink\">");
   $nh = Loader::helper('navigation');
   $isFirst = true;
   foreach($aBlocks as $ni) {
      $_c = $ni->getCollectionObject();
      if ($_c->getCollectionAttributeValue('include_quicklink')) {
         $target = $ni->getTarget();
         if ($target != '') {
            $target = 'target="' . $target . '"';
         }
         if ($ni->isActive($c) || strpos($c->getCollectionPath(), $_c->getCollectionPath()) === 0) {


It's a little different than the default header_menu.php file that has callouts to child pages, but it continues to add <ul><li> classes to each additional level and I'm not entirely sure how to customize it to make child pages show up in my quicklink nav.

Any help would be greatly appreciated! Thanks!

FatTony1952
 
TimDix replied on at Permalink Reply
TimDix
I'd suggest you NOT use the header_nav template as a basis for this, use the standard view as it supports nested children, then you'll have all the links you need correctly nested.

Unfortunately, there is a bug which makes pages which are nested show up in the wrong place if their parents are hidden (IE: Don't have the quick menu attribute). You'll have to figure out how to correctly handle this in your view.
FatTony1952 replied on at Permalink Reply
FatTony1952
Are you referring to using the view.php file within the AutoNav root folder?
TimDix replied on at Permalink Reply
TimDix
Yes
jordanlev replied on at Permalink Reply
jordanlev
Due to this bug, I recommend you actually use this as a starting point:
http://www.concrete5.org/marketplace/addons/autonav-exclude-subpage...

(which I created specifically to fix that bug).
I think if you just add this code...
if (!$_c->getCollectionAttributeValue('include_quicklink')) {
   continue;
}

...above this line (should be around line #33):
$target = $ni->getTarget();

...that should do the trick.
TimDix replied on at Permalink Reply
TimDix
Nice, has this been submitted to the core yet?
jordanlev replied on at Permalink Reply
jordanlev
No, I didn't think about that. My assumption was that there are uses for showing sub-pages of excluded pages so to completely disable that would break some peoples' existing sites. But it would be nice if it was an option. I'll add it to my exceedingly long todo list :)
RadiantWeb replied on at Permalink Reply
RadiantWeb
This was created specifically for footer navs fyi.

http://www.concrete5.org/marketplace/addons/quick-links/...

ChadStrat