-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
Hi, I am using Easy breadcrumb, and i was trying to remove the breadcrumb from the home page:
I set it as checked to be aligned with the behavior of official EC website, see https://commission.europa.eu/index_en
But it still showed, bizarrely, the name of the page as plain text:
As it was not working I looked into the code and I found this in PageHeaderBlock.php, inside oe_theme_helper module:
protected function addBreadcrumbSegments(array $build, $title = ''): array {
$breadcrumb = $this->breadcrumbBuilder->build($this->currentRouteMatch);
// Add segments to the breadcrumb key.
/** @var \Drupal\Core\Link $link */
foreach ($breadcrumb->getLinks() as $link) {
$build['#breadcrumb'][] = [
'href' => $link->getUrl(),
'label' => $link->getText(),
];
}
// Add the title to the segments only if it's not empty.
if (!empty($title)) {
$build['#breadcrumb'][] = [
'label' => $title,
];
}
// Make sure that the cache metadata from the breadcrumb is not lost.
CacheableMetadata::createFromObject($breadcrumb)->applyTo($build);
return $build;
}
Where the "Add the title to the segments only if it's not empty." is responsible for the odd behavior in my front page.
Do you know if this could be fixed?
Thank you
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels