Magento 1.9 – How to Show Product Name Above Breadcrumbs

breadcrumbsmagento-1.9theme

I am using rwd magento theme for customization.

I want to catalog/product title above the breadcrumbs section in my theme.
I also want to show this on category page.

I want to show something like the below screenshot.
How can I go about it?
Wanted output

Best Answer

you can add widget above breadcrumbs please visit:

How do I add a block on the home page above the content, below the navigation on the home page only?

you should also visit how to display product name in widget.

https://stackoverflow.com/questions/27403173/magento-how-to-use-product-link-widget-to-display-name-price-on-homepage

you can also done by local.xml

File : app\design\frontend[package][theme]\layout\local.xml

<cms_page_view> <!-- layout update handle -->
    <reference name="root"> <!-- parent block of our custom block -->
        <block type="core/template" name="my.custom.top.block" as="my_custom_top_block" template="custom/template.phtml" /> <!-- definition of custom block -->
    </reference>
</cms_page_view>

This code snippet defines our block and include it in root block in the case of a cms page rendition. This means this block will be available when a cms page is rendered in frontend. You need to include the block inside root block because it is the block which holds all structural blocks and breadcrumb block is a structural block. Obviously your block is also a structural block.

Specify Where should Custom Block Appear

This is the next important step. Defining a block will not render your block automatically. You need to specify where should it appear. For that you need to open the root template and add the below code there

File : app\design\frontend[package][theme]\template/page/[root-template].phtml

<div class="main">
<?php echo $this->getChildHtml('my_custom_top_block') ?>
    <?php echo $this->getChildHtml('breadcrumbs') ?>

    <div class="col-main">
        <?php echo $this->getChildHtml('global_messages') ?>
        <?php echo $this->getChildHtml('content') ?>
    </div>
</div>

Define your custom block template

This is the last step. Go ahead and create a custom block template which we have specified in our layout udpate.

File : app\design\frontend[package][theme]\template/custom/template.phtml

<div> UREKKAAAA </div>

Now clear the cache and load the page again.

I hope this will help you.