Magento 1.9 RWD Theme – Category View Layout

layoutmagento-1.9rwd-theme

In RWD I have a 3 column layout for category pages – I want the category 'banner image' and title to show above the columns below – sitting below the breadcrumbs. How can I go about this? Here's an illustration of the current set up…

Breadcrumbs here…

Nav sidebar here | Banner and cat title Here & Products Below

Any advice please on how to get to the following….

Breadcrumbs here…

Banner and cat title here…

Nav sidebar here | Products here

Page Layout

Best Answer

For this you need to create a structural block only for category pages. Steps to do this is given below.

1. Define your structural block

File : app\design\frontend\{package}\{theme}\layout\local.xml

<layout>
    <catalog_category_view>
        <reference name="root">
            <block type="core/template" name="category.top.banner" as="category_top_banner" template="custom/category/top_banner.phtml"></block>
        </reference>
    </catalog_category_view>
</layout>

Here <catalog_category_view /> is a specific layout update handle node for category pages. ie Magento process this layout handle only when it renders a category page. Our structural block is category.top.banner and it is added to root block.

2. Call Our Block in Root Template

File : app\design\frontend\{package}\{theme}\template\page\3columns.phtml

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

As you can see, we are calling our block just below breadcrumbs block. Follow the same step in every page layout template files (ie files inside page\ directory) in order to obtain the same result in every page layout.