Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Template Questions /

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

Not all breadcrumbs showing


Go to End


4 Posts   2494 Views

Avatar
Eurisko

Community Member, 27 Posts

10 August 2015 at 11:36pm

Hi

I have the following in templates/BreadcrumbsTemplate.ss

<div class="full-width no-padding" id="breadcrumbs">
    <div class="container">
        <div class="row row-centered">
            <div class="col-sm-12">
                    <% if Pages %>
                        <% if $URLSegment != home %>
                            <a id='homeBreadcrumb' href="/"><img src="$themeDir/images/breadcrumb-home.png"></a>

                            <% loop Pages %>
                                <% if Last %>
                                    <img src="$themeDir/images/breadcrumb-seperator-last.png"><span class="breadcrumb-last">$Title.XML</span>
                                <% else %>
                                    <img src="$themeDir/images/breadcrumb-seperator.png"> <a href="$Link">$MenuTitle.XML</a>
                                <% end_if %>
                            <% end_loop %>


                        <% end_if %>
                    <% end_if %>
            </div>
        </div>
    </div>
</div>

Which works fine for all my standard pages. I have created another page class called videoPage, that all works well and is located under a normal page called resources.

When I view the resources pages I get the expected home >> resources breadcrumb. But when I go to the /resources/videos page. I get a home >> videos page and not the expected home >> resources >> videos

Anyone got any ideas? Google is being tight lipped.
Thanks.

Avatar
Pyromanik

Community Member, 419 Posts

12 August 2015 at 12:27am

Edited: 12/08/2015 12:31am

The page's "Show In Menus" option is off.

Try $Breadcrumbs(20, false, false, true) instead of just $Breadcrumbs in your main template.

Avatar
Eurisko

Community Member, 27 Posts

12 August 2015 at 12:31am

That sorted it. As always Pyro, you are the man :) Thanks very much.

Avatar
Jemmyyy

Community Member, 4 Posts

17 May 2016 at 3:20pm

Any idea how to include data from dataObjects onto the breadcrumbs? E.g. home>regions>South Island>Canterbury (where canterbury is a dataObject)