How to change the breadcrumb separator on SilverStripe

by frank on September 13, 2010

in SilverStripe, Tips of the Week

Quick tip to change the separator used by SilverStripe to separate the links of the breadcrumb.

By default SilverStripe uses » to separate breadcrumb links, in the SiteTree class there is a public static varaible called breadcrumbs_delimiter:

/**
 * Delimit breadcrumb-links generated by BreadCrumbs()
 *
 * @var string
 */
public static $breadcrumbs_delimiter = " » ";

This makes it fairly straight forward to change the breadcrumb delimiter used anywhere in your PHP classes, if you want to change the breadcrumb separator used throughout the site its probably easiest to set in the _config.php file:

SiteTree::$breadcrumbs_delimiter = " » ";
//Or something like
SiteTree::$breadcrumbs_delimiter = " <span class='breadcrumb-seperator'><img src='themes/".SSViewer::current_theme()."/images/arrow.jpg' /></span> ";

Thanks to Dylan (Pyromanik) for contributing to this post.

Was this article useful?

rss feed icon

Email this article to yourself or...

rss feed icon

Subscribe to the RSS feed for more useful articles and tips.

Share this article with others

  • del.icio.us
  • Twitter
  • Reddit
  • StumbleUpon
  • Facebook
  • Digg