Magento Themes and Magento Extensions

Moving Categories to Left Column Magento

Share

In this post I will be showing you how to output Magento categories into the left column.

First off you will need to create the file which outputs all of the active categories, to do this create the file app/design/frontend/default/YOURTHEME/template/catalog/navigation/left-nav.phtml

Inside left-nav.phtml add this code

__(‘Categories’) ?>

The code checks if the category is active, and if it is outputs it into a list.

After you have finished the steps above you will need to define the code in your layout, to do this open this file: /public_html/app/design/frontend/default/YOURTHEME/layout/page.xml

Search for the block which defines 2columns-left, you should have a line of code that looks like this:

<block type="core/text_list" name="left" as="left" translate="label">

Inside this block add this line of code:

<block type="catalog/navigation" name="category.listing" as="left_nav" before="-" template="catalog/navigation/left-nav.phtml" />

I have added before=”-”, this will output your categories before anything else in ‘left_nav’. Most people will want this when adding a left navigation, however if you don’t just remove it.

The Final step to outputting this is to open /public_html/app/design/frontend/default/YOURTHEME/template/page/2columns-left.phtml and add this line of code:

<?php echo $this->getChildHtml('left_nav') ?>

Comments are closed.