Breadcrumb menu in multi language site

Permalink
Hi everyone,

I've been trying to use a breadcrumb menu in my multi language site.

My Problem is that the site structure acutally starts on the second level due to internationalization.

So the breadcrumb using autonav creates something like this:

HOME > Home > About Us
or in German
HOME > Willkommen > Über uns

I would like to skip the first entry (HOME)

How would I do that?

That's the code I'm currently using.
<?php 
    $bt_main = BlockType::getByHandle('autonav'); 
    $bt_main->controller->displayPages = 'top'; 
    $bt_main->controller->orderBy = 'display_asc'; 
    $bt_main->controller->displaySubPages = 'relevant_breadcrumb';
    $bt_main->controller->displaySubPageLevels = 'all';  
    $bt_main->controller->displayPagesIncludeSelf = 1; 
    $bt_main->render('templates/breadcrumb'); 
   ?>


Thanks
- Karl

 
KarlWecker replied on at Permalink Reply
Actually, using
$bt_main->controller->displayPages = 'second_level';

instead of
$bt_main->controller->displayPages = 'top';


helps a little, but doesn't really solve the problem. Now "HOME" and "home" are gone.

-Karl
crimsonfox replied on at Permalink Reply
Hi Karl,

I am having the same issue. Did you ever find a solution?

Cheers
Steve
doterobcn replied on at Permalink Reply
Hi,
I finally found a way to solve this.
Basically, you need to modify the template that generates the breadcrumbs.
Create this folder structure:
/blocks/autonav/templates/
Caeate a file named breadcrumb.php on that folder, and put this code:
<?php  defined('C5_EXECUTE') or die("Access Denied.");
$navItems = $controller->getNavItems(true);
for ($i = 1; $i < count($navItems); $i++) {
   $ni = $navItems[$i];
   if ($i > 1) {
      echo ' <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>';
   }
}


This is a copy of the file originally found in /concrete/blocks/autonav/templates/breadcrumb.php
The original file, writes the navigation starting at the index 0, and this version, starts at index 1 (for ($i = 1...)

Hope this works for you!