Jump to:

23552 Posts in 19349 Topics by 2891 members

General Questions

SilverStripe Forums » General Questions » Custom Breadcrumbs Delimiter

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 2349 Views
  • micahsheets
    Avatar
    Community Member
    164 Posts

    Custom Breadcrumbs Delimiter Link to this post

    I have searched the forum and found that adding SiteTree::breadcrumbs_delimiter = " | "; to _config.php should do the trick. However adding this line produces this error "Parse error: syntax error, unexpected '=' ".

    In SiteTree the breadcrumbs_delimiter is a public static variable so does this mean that I can't just set it in my Page.ss file? Is that what static means when declaring a property in a class? I am still new to OOP so some of this doesn't make sense to me yet.

  • Willr
    Avatar
    Forum Moderator
    5511 Posts

    Re: Custom Breadcrumbs Delimiter Link to this post

    Looks like you are missing a $ before the variable name

    SiteTree::$breadcrumbs_delimiter = "|";

  • micahsheets
    Avatar
    Community Member
    164 Posts

    Re: Custom Breadcrumbs Delimiter Link to this post

    Ah, yes. I guess I missed a very obvious detail. Thanks for the help.

  • bunheng
    Avatar
    Community Member
    78 Posts

    Re: Custom Breadcrumbs Delimiter Link to this post

    Hi,

    First of all thanks for your contribution, I would like to know is it possible to use Breadcrumbs Delimiter like this
    SiteTree::$breadcrumbs_delimiter = "<li>";

    Thanks.
    Bunheng

  • Willr
    Avatar
    Forum Moderator
    5511 Posts

    Re: Custom Breadcrumbs Delimiter Link to this post

    No, you can't use li's. The delimiter is simply put between the links. If you want to use list items copy the Breadcrumbs function from SiteTree.php to your Page class and alter the HTML inside that function. One day that will be spilt out to a separate include template!

  • bunheng
    Avatar
    Community Member
    78 Posts

    Re: Custom Breadcrumbs Delimiter Link to this post

    Hi Willr,

    thanks for important advice, I copied the function into page and customise it.

    Thanks.
    Bunheng

    2349 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.