01446 620436

BreadcrumbNavigation

The BreadcrumbNavigation module is a self contained module that allows for greater flexibility and styling using the SilverStripe templating engine, including addition of form and page/actiond/ID generated content.

Download

SilverStripe 3.0

SilverStripe 2.4

Requirements

  • SilverStripe Trunk

Install and setup

BreadcrumbNavigation should be in your sites root folder.

Set options in your mysite/_config.php

BreadcrumbNavigation::$includeHome = false;
BreadcrumbNavigation::$includeSelf = true;
BreadcrumbNavigation::$maxDepth = 20;
BreadcrumbNavigation::$stopAtPageType = false;
BreadcrumbNavigation::$showHidden = false;
BreadcrumbNavigation::$homeURLSegment = 'home';

In your template include either:

<% include BreadcrumbNavigationTemplate %> 

or

<% include BreadcrumbNavigationTemplateAllLinked %>

Advanced use

If you would like to add additional items to the Breadcrumb trail (e.g. for URL parameter actions) you can use AddBreadcrumbAfter($object) and AddBreadcrumbBefore($object) in SilverStripe 3.0 [For SS 2.4: AddAfter($object) and AddBefore($object)] functions. You only need to define the attributes you use in your templates. These are Link and MenuTitle for the supplied templates. Define isSelf if you are not linking the current page.

SilverStripe 3.0

$do = new DataObject();
$do->Link = $this->Link() . "show";
$do->MenuTitle = "Menu title";
$do->isSelf = true;
$this->AddBreadcrumbAfter($do); 

SilverStripe 2.4

$do = new DataObject();
$do->Link = $this->Link() . "show";
$do->MenuTitle = "Menu title";
$do->isSelf = true;
$this->AddAfter($do);