1

I want to display the breadcrumbs in list page alone to display inside the grid exactly just above the toolbar.

So I entered this line of code:

<?php echo $this->getChildHtml('breadcrumbs') ?>

just above the line :

<?php echo $this->getToolbarHtml() ?>

in app/design/frontend/<package>/<theme>/template/catalog/list.phtml.

But nothing is getting displayed.

I want to change the position of breadcrumbs only in list page. Why the above procedure not working. Is there anything wrong to use getChildHtml() to call block like this?

1

getChildHtml() method only works if there's a corresponding child in the current block.

However, natively Magento breadcrumbs is not a child of the product list, that's why your code is not working.

To do so, you will have to edit/create app/design/frontend/<package>/<theme>/layout/local.xml with the following code:

<catalog_category_default>
    <action block="root" method="unsetChild"><name>breadcrumbs</name></action>
    <action block="product_list" method="insert"><name>breadcrumbs</name></action>
</catalog_category_default>

<catalog_category_layered>
    <action block="root" method="unsetChild"><name>breadcrumbs</name></action>
    <action block="product_list" method="insert"><name>breadcrumbs</name></action>
</catalog_category_layered>
  • 1
    Thank you @Raphael at Digital. I have another doubt. I will just post as another question. Guide me in that too please. – Ramya Jun 29 '16 at 8:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.