public function TaxonomyDisplayBreadcrumbDisplayHandlerCore::buildBreadcrumb in Taxonomy display 7
Do not display anything to the user, we return an empty string.
Overrides TaxonomyDisplayBreadcrumbDisplayHandler::buildBreadcrumb
See also
TaxonomyDisplayBreadcrumbDisplayHandler::buildBreacrumb()
1 method overrides TaxonomyDisplayBreadcrumbDisplayHandlerCore::buildBreadcrumb()
- TaxonomyDisplayBreadcrumbDisplayHandlerIgnore::buildBreadcrumb in handlers/
breadcrumb/ ignore.inc - Do not display anything to the user, we return an empty string.
File
- handlers/
breadcrumb/ core.inc, line 12
Class
- TaxonomyDisplayBreadcrumbDisplayHandlerCore
- Add a display handler to generate the same breadcrumb from Drupal core.
Code
public function buildBreadcrumb($term) {
// Build breadcrumb like core does.
// @see taxonomy_term_page()
$current = (object) array(
'tid' => $term->tid,
);
$breadcrumb = array();
while ($parents = taxonomy_get_parents($current->tid)) {
// Allow modules like i18n_taxonomy to alter the parents.
drupal_alter('taxonomy_display_breadcrumb_parents', $parents);
$current = array_shift($parents);
$breadcrumb[] = l($current->name, 'taxonomy/term/' . $current->tid);
}
$breadcrumb[] = l(t('Home'), NULL);
$breadcrumb = array_reverse($breadcrumb);
drupal_set_breadcrumb($breadcrumb);
}