/** * Add the parent to the breadcrumb. * * @param ContentModel $model The content model. * @param Breadcrumb $breadcrumb The breadcrumb. * * @return void */ private function addParentToBreadcrumb(ContentModel $model, Breadcrumb $breadcrumb) { if ($model) { switch ($model->ptable) { case 'tl_article': case '': $article = \ArticleModel::findByPk($model->pid); $breadcrumb->addNode($article->id, $article->title, 'article', false); break; // TODO: News and Events // TODO: Event for others. // TODO: News and Events // TODO: Event for others. default: // Do Nothing. } } }
/** * {@inheritDoc} */ public function buildBreadcrumb(Breadcrumb $breadcrumb, ContentModel $node) { $label = $this->translator->translate($this->getName() . '.0', 'CTE', ['id' => $node->id]); $breadcrumb->addNode($node->id, $label, 'node-' . $node->type); return $this; }