I have changed the footer to include a new link “Children books”. I have created a page for children books from magento admin panel “CMS->Manage Pages-> New Page”
When i am view this page its showing breadcrumb like “Home/ Children Books” where as i want it as “Home/ Books/ Children Books”
But also remeber that i have an “About Us” link in my website whose breadcrumb should be like “Home/ About Us” not “Home/ Books/ About Us”
Please tell me how can i customize the breadcrumb properly??
As you can see we didn’t get any replies from magento forum, so we have done this manually by adding the breadcrumb at our static pages. To do so we have first disabled the breadcrumb for CMS pages from “System -> Configuration -> Web -> under ‘Default Page Section’ put ‘No’ for ‘Show breadcrumbs for CMS pages’ “
This will disable the breadcrumb of all your static (CMS) pages, then add the following markup in starting of your static pages.
<h4 class="no-display">You’re currently on:</h4>
<ul class="breadcrumbs">
<li class="home">
<a href="{{store url=""}}" title="Go to Home Page">Home</a>
</li>
<li> / </li>
<li>
<a href="{{store url=""}}Books" title="Page Name">Your Previous Page Name</a>
</li>
<li> / </li>
<li>
<strong>Your Current Page Name</strong>
</li>
</ul>
"Children Books” is a sub-category of “Books” isn’t it?
If I understand your problem properly you don’t need to create a cms page, you only need to create a new sub-category called “Children Books” under your “Books” category. Then you will get the “Home / Books / Children Books” breadcrumb navigation.
I don’t know if this helps you or not, but going into app/design/default/default/template_name/templates/page/html/breadcrumb.phtml should be the file you need to edit. The path may be slightly off but hopefully that points you in the right direction.
If I understand your problem properly you don’t need to create a cms page, you only need to create a new sub-category called “Children Books” under your “Books” category. Then you will get the “Home / Books / Children Books” breadcrumb navigation.
If you do that and then make the Children’s Books category a ‘static block only’ one and then create your CMS as a static block (rather than a CMS page) then you can have your CMS displayed with a breadcrumb?
Well I too was struggling to edit the breadcrumbs of CMS page for ages and found the solution.
After long days, I got the idea.
If you want to edit the breadcrumbs of the CMS you have to go to app\code\core\Mage\Cms\Block and choose page.php and go to // show breadcrumbs at line 55 and play with it.
If you know PHP, you can play with breadcrumbs.
Keep in mind when you upgrade the Magento version to a newer version those files will be overwrite by Magento.
However, the above code will only work if you update the addCrumb method. The original addCrumb method doesn’t support the “after” claus. The new method I wrote below will support <after></after> in the XML and place the breadcrumb accordingly. Just use the “crumbName” in the <after></after> XML data. For example, the crumbName for the home page is “home”
app/code/code/Mage/Page/Block/Html/Breadcrumbs.php - line 59
Update the method to this:
thanks very much for that code!! I added 2 little lines of code because I have 2 storeviews and only one breadcrumb. That’s why I need the baseUrl in the link. I did not find out how to use a helper in my xml configuration. I decided to just always add the base url when I use the after param.