27 May

How to display Breadcrumbs in your theme

: 2 Comments

Hello dear ones, i’ll explain today how you can add breadcrumbs in your theme pages. It’s very simple, take a look:

1) Open up app/design/frontend/default/yourtheme/layout/page.xml
Then be sure to have this line, or if you don’t have it, add it:

<block type=”page/html_breadcrumbs” name=”breadcrumbs” as=”breadcrumbs”/>

It will depend of where you want to display breadcrumbs and the theme structure, but most likely this line is under the tempalte page call, for example 2columns-left:

<block type=”page/html” name=”root” output=”toHtml” template=”page/2columns-left.phtml”>

Or if your theme is structured in a 2columns-right pages, the line would look like:

<block type=”page/html” name=”root” output=”toHtml” template=”page/2columns-right.phtml”>

Finally, it must look like:
<block type=”page/html” name=”root” output=”toHtml” template=”page/2columns-left.phtml”>
<block type=”page/html_breadcrumbs” name=”breadcrumbs” as=”breadcrumbs”/>
</block>

2) Now you have to add another call to the breadcrumbs, but this time in the .phtml files. Again, it will depend of where you want to display breadcrumbs, in this example they’ll show up in the top of the category page (if your category page is 2columns-left):
File: app/design/frontend/default/yourtheme/template/page/2columns-left.phtml  :

<div class=”main-container col2-left-layout”>
<div class=”main row”>
<?php echo $this->getChildHtml(‘breadcrumbs’) ?>
.
.
.
</div>
</div>

That’s all! ;)

  • Walter

    Hello!

    This isn’t working with the HelloPress Theme right?

    Thanks.

  • wordpress themes

    Nice Blog.
    This is interesting and good topic.
    Thank you for sharing.

Back to Top