Magento – Adding category title, image and description to above layered nav

categorylayout

I'm trying to make a small change to the 2 columns left design for the default category pages (specifically layer navigation). My design calls for adding the category title, description and thumbnail to the left column right above the layer navigation.

The problem is I can't find anything relevant at all. Searching for category and columns just brings forth the mass swarm of people who want to move columns around, not add to them.

I've tried adding a new block reference to XML files and adding a new phtml template for them but after about 10 tries of different methods of adding references blocks functions code snippets I've completely lost track and have no clue what the correct (or any working) method is.

If anyone can point me in the right direction at-least I'd at least be very grateful.

Best Answer

You can retrieve the active category and output it's values

$category = Mage::registry('current_category');
echo $category->getName();
echo $category->getDescr();
// etc

This can be done from any existing PHTML file that is placed there or by adding your own file like so:

local.xml

<catalog_category_layered>
    <reference name="left">
        <block type="core/template" name="top_cat_title" before="-" template="catalog/category/custom_title.phtml"/>
    </reference>
</catalog_category_layered>

Now create a PHTML file in the templates catalog/category directory called custom_title.phtml and add the above PHP code.

This will display the current category data for you

Related Topic