public function Breadcrumbs() { //Get the default breadcrumbs $Breadcrumbs = parent::Breadcrumbs(); if ($CommMember = $this->getCommMember()) { //Explode them into their individual parts $Parts = explode(SiteTree::$breadcrumbs_delimiter, $Breadcrumbs); //Count the parts $NumOfParts = count($Parts); //Change the last item to a link instead of just text $Parts[$NumOfParts - 1] = "<a href=\"" . $this->Link() . "\">" . $this->Title . "</a>"; //Add our extra piece on the end $Parts[$NumOfParts] = $CommMember->Name; //Return the imploded array $Breadcrumbs = implode(SiteTree::$breadcrumbs_delimiter, $Parts); } return $Breadcrumbs; }
/** * manipulates the defaul logic of building the pages breadcrumbs if a * product detail view is requested. * * @param int $maxDepth maximum depth level of shown pages in breadcrumbs * @param bool $unlinked true, if the breadcrumbs should be displayed without links * @param string $stopAtPageType name of pagetype to stop at * @param bool $showHidden true, if hidden pages should be displayed in breadcrumbs * @param bool $showProductTitle true, if product title should be displayed in breadcrumbs * * @return string * * @author Sebastian Diel <*****@*****.**> * @since 22.04.2015 */ public function Breadcrumbs($maxDepth = 20, $unlinked = false, $stopAtPageType = false, $showHidden = false, $showProductTitle = true) { if ($this->isProductDetailView()) { return $this->BreadcrumbsForProduct($maxDepth, $unlinked, $stopAtPageType, $showHidden, $showProductTitle); } $breadcrumbs = null; $this->extend('overwriteBreadcrumbs', $breadcrumbs); if (is_null($breadcrumbs)) { $breadcrumbs = parent::Breadcrumbs($maxDepth, $unlinked, $stopAtPageType, $showHidden); } return $breadcrumbs; }