Layout Update – How to Update Breadcrumbs phtml File via local.xml

breadcrumbslayoutlayout-update

I'm trying to update the breadcrumbs phtml file being used. I've unset the existing crumb block in layout:

<action method="unsetChild"><name>breadcrumbs</name></action>

But adding the below doesn't output anything. I think the new phtml is being called (a duplicate of the default breadcrumbs.phtml), but $crumbs is empty:

<reference name="content">
<block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs" template="page/html/breadcrumbs_category.phtml" />
</reference>

Thanks

Best Answer

As you want to up date the template file,so you don't need to remove breadcrumbs block from layout and again add breadcrumbs block.

Just need change template file using setTemplate function at layout xml

Code:

<reference name="breadcrumbs">
<action method="setTemplate"><template>page/html/breadcrumbs_category.phtml</template></action>
</reference>

May be you want for category page then use below:

<catalog_category_layered><!-- for Anhor Category  -->
 <reference name="breadcrumbs">
    <action method="setTemplate"><template>page/html/breadcrumbs_category.phtml</template></action>
    </reference>
</catalog_category_layered>


<catalog_category_default><!-- for Non-Anhor Category  -->
 <reference name="breadcrumbs">
    <action method="setTemplate"><template>page/html/breadcrumbs_category.phtml</template></action>
    </reference>
</catalog_category_default>