Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Template Questions /

Custom Breadcrumbs fatal error




Community Member, 9 Posts

19 April 2011 at 8:41am

I'm new to SS and object-oriented coding...

been working SS advanced tutorial found on :

applied it, and it worked perfectly on my machine, untill I uploaded the website on the production server, and their I get this error when I try to view a category page:

Fatal error: Call to undefined method Page_Controller::breadcrumbs() in /home/master/public_html/beta/mysite/code/CategoryPage.php on line 86

the file in question CategoryPage.php is here below:

class CategoryPage_Controller extends Page_Controller

//Generate out custom breadcrumbs
public function Breadcrumbs() {

//Get the default breadcrumbs
$Breadcrumbs = parent::Breadcrumbs();

if($Project = $this->getCurrentProject())
//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() . '">' . $Parts[$NumOfParts-1] . '</a>');

//Add our extra piece on the end
$Parts[$NumOfParts] = $Project->Title;

//Return the imploded array
$Breadcrumbs = implode(SiteTree::$breadcrumbs_delimiter, $Parts);

return $Breadcrumbs;
//hides the "show" from the url
public static $url_handlers = array('$ID!' => 'show');


I don't know what could be the issue, it probably should be related to the server's configuration, I can't see anything else because I got it from this great tutorial, and it works locally....