Skip to content

Commit

Permalink
add Home link to breadcrumbs (#759)
Browse files Browse the repository at this point in the history
  • Loading branch information
seth-shaw-unlv authored Feb 13, 2020
1 parent 6d54ff9 commit f5d98ab
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Breadcrumb\Breadcrumb;
use Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface;
use Drupal\Core\Link;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;

/**
* Provides breadcrumbs for nodes using a configured entity reference field.
*/
class IslandoraBreadcrumbBuilder implements BreadcrumbBuilderInterface {
use StringTranslationTrait;

/**
* The configuration.
Expand Down Expand Up @@ -63,6 +66,7 @@ public function build(RouteMatchInterface $route_match) {
$nid = $route_match->getRawParameters()->get('node');
$node = $this->nodeStorage->load($nid);
$breadcrumb = new Breadcrumb();
$breadcrumb->addLink(Link::createFromRoute($this->t('Home'), '<front>'));

$chain = [];
$this->walkMembership($node, $chain);
Expand Down

0 comments on commit f5d98ab

Please sign in to comment.