Skip to content

Latest commit

 

History

History
11 lines (7 loc) · 707 Bytes

add-unlinked-item-to-drupal-breadcrumb.md

File metadata and controls

11 lines (7 loc) · 707 Bytes

Add an unlinked item to the breadcrumb in Drupal 8

Using the Drupal Breadcrumb class, if you want to add a crumb that is not linked to anything, create a link that has the route of <none>.

$breadcrumb->addLink(Link::createFromRoute($this->t('Current Page Title'), '<none>'));

This snippet is useful if you want to tack on the title of the current node, a taxonomy term name, or some other word to the end of the breadcrumb.

Found on Drupal Stack Exchange.