Jump to:

22976 Posts in 11702 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » MenuTitle instead of title in breadcrumbs

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: 1142 Views
  • suntrop
    Avatar
    Community Member
    131 Posts

    MenuTitle instead of title in breadcrumbs Link to this post

    I want to display in breadcrumbs the navigation links nstead the title of that page (all titles are pretty long and to navigate I prefer to use the navigation ;)

    I found that in the archive: http://www.silverstripe.org/archive/show/31772
    Unfortunately it doesn't work. i changed
    SiteTree.php breadcumbs()

    $parts[] = ("<a href=\"" . $page->Link() . "\">" . Convert::raw2xml($page->Title) . "</a>");


    to

    $parts[] = ("<a href=\"" . $page->Link() . "\">" . Convert::raw2xml($page->MenuTitle) . "</a>");

    That post was 2 year old. Is there something new to v2.4 I have to change?

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: MenuTitle instead of title in breadcrumbs Link to this post

    You should never edit anything in sapphire/ or cms/ (if you can avoid it) since it'll make upgrading annoying!

    What you can do in the breadcrumbs case is copy the SiteTree::breadcrumbs() function to your Page.php file and customize it as much as you want!

  • suntrop
    Avatar
    Community Member
    131 Posts

    Re: MenuTitle instead of title in breadcrumbs Link to this post

    Hi Willr. Thanks for that. I didn't thought of this way since I am not that familiar with OOP. But you are right, that is much better! And works.

    Thanks!

    1142 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.