How to show Excluded HOME page from NAV in Breadcrumbs?

Permalink
I have chosen 'Exclude from Nav' for my Home page as I do not want the Home link appearing in the main menu. However doing this removes the Home link from the Breadcrumbs throughout my site.

I use the following Breadcrumbs Custom Template, is there an easy tweak to add a 'Home' link to the begining of the Breadcrumbs?

<?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();
      if (!$_c->getCollectionAttributeValue('exclude_nav')) {   
         $pageLink = false;
         $target = $ni->getTarget();
         if ($target != '') {
            $target = 'target="' . $target . '"';
         }
         if ($_c->getCollectionAttributeValue('replace_link_with_first_in_nav')) {

IVT
View Replies:
jkernick replied on at Permalink Reply
jkernick
I'm trying to figure out how to do this too, any luck?
roggy replied on at Permalink Reply
roggy
I know that the thread is old .. but maybe I can still help. I needed a home link only for the breadcrumb navigation. So I checked the attribute for the home page exclude_from_nav copied the breadcrumb.php from mysite/concrete/blocks/autonav/templates to mysite/blocks/autonav/tempates

and modified it:

<?php  defined('C5_EXECUTE') or die(_("Access Denied."));
$navItems = $controller->getNavItems();
foreach ($navItems as $ni) {
   if (!$ni->isFirst) {
      echo ' <span class="ccm-autonav-breadcrumb-sep">></span> ';
   } else {
      echo '<a href="/">Domov</a> <span class="ccm-autonav-breadcrumb-sep">></span> ';
   }
   if ($ni->isCurrent) {
      echo $ni->name;
   } else {
      echo '<a href="' . $ni->url . '" target="' . $ni->target . '">' . $ni->name . '</a>';
   }
}


Find out that the code above is not exactly right .. need to fix it. But the idea behind is still valid ;)