You are here

protected function crumbs_CurrentPageInfo::metaBreadcrumbItems in Crumbs, the Breadcrumbs suite 7.2

List of breadcrumb items to show in search engine results.

This can be slightly different from the items shown on the page:

  • The home page is never part of the SEO breadcrumb.
  • The current page is never part of the SEO breadcrumb.

Return value

array[]

See also

$metaBreadcrumbItems

File

lib/CurrentPageInfo.php, line 311

Class

crumbs_CurrentPageInfo
Creates various data related to the current page.

Code

protected function metaBreadcrumbItems() {
  if ($this->breadcrumbSuppressed) {
    return array();
  }
  $trail = $this->trail;

  // Never show the front page link in search engine results.
  array_shift($trail);

  // Never show the front page link in search engine results.
  array_pop($trail);
  if (array() === $trail) {

    // Hide search engine breadcrumb if it is empty.
    return array();
  }
  $items = $this->breadcrumbBuilder
    ->buildBreadcrumb($trail);
  if (array() === $trail) {

    // Some items might get lost due to having an empty title.
    return array();
  }
  $router_item = $this->router
    ->getRouterItem($this->path);

  // Allow modules to alter the breadcrumb, if possible, as that is much
  // faster than rebuilding an entirely new active trail.
  drupal_alter('menu_breadcrumb', $items, $router_item);
  if (array() === $trail) {

    // Some items might get lost during the altering.
    return array();
  }
  return $items;
}