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?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityI 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?
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.
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.
You would need to create a new structural block, reference it in the page templates and then create a new .phtml file which references the product title. Then place the xml in your local.xml theme file.
<catalog_product_view>
<reference name="new_structural_block_name">
<block type="catalog/product_view" name="product.name" template="pathtofile/product-title.phtml"></reference></catalog_product_view>
Your .phtml template file will look something like this
$_product = $this->getProduct(); $_productName = $_product->getName(); echo $_productName;