Jump to:

3431 Posts in 1025 Topics by 864 members

Template Questions

SilverStripe Forums » Template Questions » How to pass parameters to $Breadcrumbs?

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

Page: 1
Go to End
Author Topic: 837 Views
  • juergr
    Avatar
    Community Member
    17 Posts

    How to pass parameters to $Breadcrumbs? Link to this post

    I want to display Hidden pages in the Breadcrumbs and I tried different things, but nothing seems to work.

    Basicaly this is my BreadCrumbs.ss:

    <div id="Breadcrumbs" class="grid_9 alpha">
    <p>$Breadcrumbs</p>
    </div>

    And I include it in the Page.ss like this:

    <% if Level(2) %>
    <% include BreadCrumbs %>
    <% end_if %>

    At first i was trying to simply pass the parameters like this, bit this is not working, the breadcrumbs stay the same

    $Breadcrumbs(20, false, false, true)

    then I tried this: (as described here: http://doc.silverstripe.org/sapphire/en/reference/built-in-page-controls#site-navigation-breadcrumbs

    <div id="Breadcrumbs" class="grid_9 alpha">
    <p><% control Breadcrumbs(20, false, false, true) %></p>
    </div>

    But then I get a error, of course, there is a missing end_control! But if I add this missing piece, the breadcrumbs dissapear.

    So, can anyone help me please? What am I doing wrong?

  • Willr
    Avatar
    Forum Moderator
    5482 Posts

    Re: How to pass parameters to $Breadcrumbs? Link to this post

    Try setting that configuration in your Page class.

    public function Breadcrumbs() {
    return parent::Breadcrumbs(20, false, false, true);
    }

    Then you can simply use $Breadcrumbs in your template. I think the issue would be around passing so many arguments to SSViewer.

  • juergr
    Avatar
    Community Member
    17 Posts

    Re: How to pass parameters to $Breadcrumbs? Link to this post

    Ok, this way it works like a charm.

    So multiple parameters are not supported by the SSViewer?

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