How do I do breadcrumbs with system pages showing in 5.5.1

Permalink
I'm trying to slice up a new theme using 5.5.1, it's my second attempt at a 5.5.1 theme though I've done tons of themes for older sites. I'm getting kind of stuck on the breadcrumbs part. I've always done these hard coded inside of an element.

My element:

<?php defined('C5_EXECUTE') or die("Access Denied."); ?>
<?php
$bt = BlockType::getByHandle('autonav');
$bt->controller->displayPages = 'top';
$bt->controller->orderBy = 'display_asc';
$bt->controller->displaySubPages = 'relevant_breadcrumb';
$bt->controller->displaySubPageLevels = 'all';
$bt->controller->displaySystemPages = true;
$bt->controller->displayUnavailablePages = false;
$bt->controller->displayPagesIncludeSelf = 1;
$bt->render('templates/sentek_breadcrumb')
?>


And then my breadcrumb template:

<?php  
   defined('C5_EXECUTE') or die("Access Denied.");
   $aBlocks = $controller->generateNav();
   $c = Page::getCurrentPage();
   $nh = Loader::helper('navigation');
   $i = 0;
   foreach($aBlocks as $ni) {
      $_c = $ni->getCollectionObject();
      $pageLink = false;
      $target = $ni->getTarget();
      if ($target != '') {
         $target = 'target="' . $target . '"';
      }
      if ($_c->getCollectionAttributeValue('replace_link_with_first_in_nav')) {
         $subPage = $_c->getFirstChild();


In 5.4.2.2 the $controller->generateNav() comes back with an array with two objects, home and login. In 5.5.1 it comes back with an array with only one object, home. Is the setting for displaySystemPages no longer valid in 5.5.1? How do I get it to display both the home and the login page in the breadcrumbs?

hereNT
 
hereNT replied on at Permalink Best Answer Reply
hereNT
It turns out this wasn't a code issue, it was a database issue. In 5.5 the login page has a cParentID of 0, so it essentially doesn't live in the site map. So when you go to show it in breadcrumb view the nav generation fails because collection parent id is 0. When I went into the database and manually updated the value for cParentID to 1 for the home page the page now shows up in the autonav.