0

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.

2

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

  • Thank you. I didn't bother creating a block in the end and just inserted the new code into the new cat specific layout file. Seems all I was missing in the end was the correct way of getting the current category. – Chris Morris Sep 11 '13 at 13:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.