You are here

function hook_taxonomy_display_breadcrumb_parents_alter in Taxonomy display 7

Alter breadcrumb parents before rendering into breadcrumb on term page.

This would be an ideal place to perform translation, set active menus, or modify the crumbs.

Parameters

array $parents: An array of term objects that are parents of the current term.

Return value

void

See also

TaxonomyDisplayBreadcrumbDisplayHandlerCore::buildBreadcrumb()

1 invocation of hook_taxonomy_display_breadcrumb_parents_alter()
TaxonomyDisplayBreadcrumbDisplayHandlerCore::buildBreadcrumb in handlers/breadcrumb/core.inc
Do not display anything to the user, we return an empty string.

File

./taxonomy_display.api.php, line 26
Hooks provided by the taxonomy_display module.

Code

function hook_taxonomy_display_breadcrumb_parents_alter(&$parents) {

  // Manipulate or act upon the term parents.
  foreach ($parents as &$parent_term) {
    if ($parent_term->name == 'example alter') {
      $parent_term->name = 'a better term name';
    }
  }
}