Creating Custom Breadcrumbs For CMS Pages In Magento



In Magento suppose we have created the subordinate set of CMS pages and wants the breadcrumb navigation at the top of the page as Home > Parent CMS Page > Child CMS Page, Magento did not provides the breadcrumb for the CMS pages as per the requirements, so we have to insert some XML code into the CMS page layout through the Magento admin panel. This can we achieved by using the steps given below:

Step 1. Login to the Magento admin Panel and Navigate to CMS > page’s Design > Page Layout > Layout Update XML field
CMS PAGE

Step 2. Insert the code below into the Layout Update XML field

<reference name="root">
<action method="unsetChild"><alias>breadcrumbs</alias></action>
<block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs">
<action method="addCrumb">
<crumbName>Home</crumbName>
<crumbInfo><label>Home</label><title>Home</title><link>/</link></crumbInfo>
</action>
<action method="addCrumb">
<crumbName>Parent CMS Page</crumbName>
<crumbInfo><label>Parent CMS Page</label><title>Parent CMS Page</title><link>/parent-cms-page-url</link></crumbInfo>
</action>
<action method="addCrumb">
<crumbName>Child CMS Page</crumbName>
<crumbInfo><label>Child CMS Page</label><title>Child CMS Page</title></crumbInfo>
</action>
</block>
</reference>

Step 3. Change the parameter with your actual one like Parent CMS Page Title,parent-cms-page-url etc.

Now Refresh the magento cache as well as the browser cache then navigate to the page and you will see the bredcrumb over there.