one of the magento’s hardest work is to customize its layout unlike the others such as joomla or wordpress that all the layout files of the templates are together

IN magento there are two types of fiels for creating the layout
one is XML and PHTML
the xml is used to address the css and javascript files tobe included in the theme and determine which of those phtml files are goind to be used
I wont dig deeper in this rather I will going to instruct you how to change the Category layout from the default 3 columns to 2 columns left or 2 columns right

navigate to

app/design/frontend/carpetnrugs/default/layout

there is a file catalog.xml
open it and look for

<catalog_category_layered>

and add this inside this block

<reference name="root">
            <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
        </reference>

The code should be changed from this:

<catalog_category_default>
        <reference name="left">
            <block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml"/>
        </reference>
        <reference name="content">
            <block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
                <block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml" />
            </block>
        </reference>
    </catalog_category_default>

To this:

<catalog_category_default>
                <reference name="root">
            <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
        </reference>
        <reference name="left">
            <block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml"/>
        </reference>
        <reference name="content">
            <block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
                <block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml" />
            </block>
        </reference>
    </catalog_category_default>

in my case it was like this but you may differ since I was using the emcomputer theme that is freely available for download on emthemes.com

<catalog_category_default translate="label">
        <label>Catalog Category (Non-Anchor)</label>
        <reference name="left">
            <block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml"/>
        </reference>
        <remove name="right.cms_customize_right" />
        <remove name="right.tags_popular" />
        <remove name="right.permanent.callout" />
        <reference name="content">
            <block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
                <block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
                    <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
                        <block type="page/html_pager" name="product_list_toolbar_pager"/>
                        <!-- The following code shows how to set your own pager increments -->
                        <!--
                            <action method="setDefaultListPerPage"><limit>4</limit></action>
                            <action method="setDefaultGridPerPage"><limit>9</limit></action>
                            <action method="addPagerLimit"><mode>list</mode><limit>2</limit></action>
                            <action method="addPagerLimit"><mode>list</mode><limit>4</limit></action>
                            <action method="addPagerLimit"><mode>list</mode><limit>6</limit></action>
                            <action method="addPagerLimit"><mode>list</mode><limit>8</limit></action>
                            <action method="addPagerLimit" translate="label"><mode>list</mode><limit>all</limit><label>All</label></action>
                        -->
                    </block>
                   
                   
                    <action method="setColumnCount"><columns>4</columns></action>
<action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>

                    <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
                </block>
            </block>
        </reference>
         
    </catalog_category_default>
<catalog_category_default translate="label">
        <label>Catalog Category (Non-Anchor)</label>
       
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
        </reference>
        <reference name="left">
            <block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml"/>
        </reference>
        <remove name="right.cms_customize_right" />
        <remove name="right.tags_popular" />
        <remove name="right.permanent.callout" />
        <reference name="content">
            <block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
                <block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
                    <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
                        <block type="page/html_pager" name="product_list_toolbar_pager"/>
                        <!-- The following code shows how to set your own pager increments -->
                        <!--
                            <action method="setDefaultListPerPage"><limit>4</limit></action>
                            <action method="setDefaultGridPerPage"><limit>9</limit></action>
                            <action method="addPagerLimit"><mode>list</mode><limit>2</limit></action>
                            <action method="addPagerLimit"><mode>list</mode><limit>4</limit></action>
                            <action method="addPagerLimit"><mode>list</mode><limit>6</limit></action>
                            <action method="addPagerLimit"><mode>list</mode><limit>8</limit></action>
                            <action method="addPagerLimit" translate="label"><mode>list</mode><limit>all</limit><label>All</label></action>
                        -->
                    </block>
                   
                   
                    <action method="setColumnCount"><columns>4</columns></action>
<action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>

                    <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
                </block>
            </block>
        </reference>
         
    </catalog_category_default>

one of the problems I had was that by edidting this file online using Cpanel file manager Editor some things would go wrong maybe some kinds of bits losts between
so I created the file localy and then uploaded the file to the directory

I hope this tutorial helped you

Thanks

Voshka Niknam

1 COMMENT

  1. Very informative article, i’m regular reader of your website.

    I noticed that your website is outranked by many other blogs in google’s search results.
    You deserve to be in top-10. I know what can help you, search in google for:
    Omond’s tips outsource the work

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.