23367 Posts in 18143 Topics by 2863 members
|Go to End|
24 February 2010 at 3:31am Last edited: 24 February 2010 3:35am
I had a request to make the breadcrumbs on our site go all the way back to the Home page... for example, we have the "top" pages "Home", "Human Resources", "Operations", etc. When I go to the "Human Resources" page, my customer wants to see in the breadcrumbs "Home>>Human Resources".
I know that the link to Home is right there above in the navigation menu, but this is what they are asking for. I'm toodling around in SiteTree.php and see the stopAtPageType section, but am not quite sure if this is the right place as I changed ClassName in (!stopAtPageType || $page->ClassName != $stopAtPageType) to HomePage (the page type for our home page) but it made no change. Is it possible to do this? Thanks.
24 February 2010 at 2:38pm
Couldn't you manually add a home link to the breadcrumbs in your template. For example in the default theme it has the following for the breadcrumbs in blackcandy/templates/Includes/Breadcrumbs.ss <p>$Breadcrumbs</p>
You could add home like
<p><% if URLSegment = home %><% else %><a href="home/">Home</a> » <% end_if %>$BreadCrumbs</p>
25 February 2010 at 3:32am Last edited: 25 February 2010 7:44am
Thanks, Willr. I added your code to the Page.ss file in /templates/layout/Page.ss in addition to the BreadCrumbs.ss file, and it works perfectly!
Thank you so much for your help!
25 February 2010 at 7:50am
I am getting one unexpected breadcrumb on the Home page and I'm not sure where it's coming from or how to get rid of it!
On the home page, the actual Page Name (which is Staff Home) appears (right above the $Title, which of course is the same, right where the breadcrumbs are). When I click on a sub page of the Home page, I do get a breadcrumb which reads "Home>>Staff Home>>EASTERN Forms", with Staff Home being the page's Page Name. If I change the Page Name to Home, I get a breadcrumb of "Home>>Home>>EASTERN Forms". Would you have any idea where this is coming from? All of the other pages work perfectly!
|Go to Top|