Active trail not producing expected results I'm writing a very simple module to alter the active trail on specific pages.  Observe.

function alter_breadcrumbs_menu_breadcrumb_alter(&amp;$active_trail, $item) {
  if (substr($item['href'], 0, 4) == 'user') {
    $num_crumbs = count($active_trail);
    $people = array(
      'href' =&gt; 'people',
      'title' =&gt; t('People'),
      'localized_options' =&gt; array(),
    );
    $active_trail[] = $people;
  }
}


The profile page by default has the breadcrumb 'Home'.  I have a directory page that has a list of users with links to their profile pages.  This page is located under /people.  So, on the user page, I want the breadcrumbs to look like 'Home > People > John Smith'.

I expect the code above to produce 'Home > People', but it doesn't.  Instead, it produces 'Home > jsmith > People'.  It puts in jsmith instead of John Smith because John Smith is derived from custom first and last name fields, but the crumbs currently just take the user's username by default, so ignore that fact for now.  What it comes down to is I don't understand why it's pushing on the username crumb and the People crumb, rather than just the People crumb.  Any insight would be helpful.

Cheers.
It looks like your adding $people to the end of the array, you have to insert it in second place, using http://php.net/manual/en/function.array-pop.php you can do something like this (untested):

$name = array_pop($active_trail);
$active_trail[] = $people;
$active_trail[] = $name;