0

I have created one custom page. Also created breadcrumb service which perfectly work for admin page but doesn't work for custom page.Even I have checked my custom theme setting where breadcrumb visibility is set true.

Snippet of code

company.services.yml services: company.breadcrumb: class: Drupal\company\Breadcrumb\CompanyBreadcrumbBuilder tags: - { name: breadcrumb_builder, priority: 100 } CompanyBreadcrumbBuilder.php namespace Drupal\company\Breadcrumb; use Drupal\Core\Breadcrumb\Breadcrumb; use Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Link; class CompanyBreadcrumbBuilder implements BreadcrumbBuilderInterface{ /** * {@inheritdoc} */ public function applies(RouteMatchInterface $attributes) { $parameters = $attributes->getParameters()->all(); return true; } /** * {@inheritdoc} */ public function build(RouteMatchInterface $route_match) { $breadcrumb = new Breadcrumb(); $breadcrumb->addLink(Link::createFromRoute('Home', '<front>')); $breadcrumb->addLink(Link::createFromRoute('Article', '<front>')); return $breadcrumb; } } 

m missing something like setting?

Note: I m using bootstrap as base theme.

3
  • 1
    You still have to ensure the block is being output in a region or you are injecting the breadcrumb as a twig variable. Commented May 28, 2018 at 14:50
  • 1
    YEP what ^^^ Kevin said make sure you place the block ! Commented May 30, 2018 at 0:31
  • Thanks. Breadcrumb block was disable under block list. Once it was enable it was working perfectly. Commented May 30, 2018 at 5:35

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.