1

I want set ALL Porduct List page in 2-colums-left.phmtml for what i want to change i am do in page.xml is it right?

<catalog_category_default translate="label">
 <reference name="root">
     <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
 </reference>
    <label>Catalog Category (Non-Anchor)</label>
    <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 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="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
                <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
                <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
                <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
                <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
                <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
            </block>
        </block>
    </reference>
</catalog_category_default>
  • by default all product list page will be 2 column left layout page.what you want to do exactly – Pradeep Sanku Sep 18 '14 at 10:25
  • All prodoct page have set only 2-colums-left.phtml template. at time some product 1-colums.phtml template in some product in 2-colums-right. i want all product are only in 2-clums-left.phml. then where to change. – coder Sep 18 '14 at 10:28
  • 2
    Please do not edit page.xml (the core file) and use the local.xml of your design theme instead. – Anna Völkl Sep 18 '14 at 10:33
  • 1
    I'm not sure if you talk about product list (category page) or the product page itself. In both ways, there can be a layout override in the Magento admin: For products: [Product Edit Page] > Design > Page Layout, for product list: [Category Edit Page] > Custom Design > Page Layout – Anna Völkl Sep 18 '14 at 10:37
2

If you need to set page template for all categories, you need to take into consideration of default categories as well as layered categories. Use local.xml file for this. This way you will not touch any core files and hence it is highly recommented

File : app\design\frontend\<your_package>\<your_theme>\layout\local.xml

<?xml version="1.0"?>
<layout version="0.1.0">
    <catalog_category_default>  <!-- for default categories -->
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
        </reference>
    </catalog_category_default>
    <catalog_category_layered> <!-- for layered categories  -->
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
        </reference>
    </catalog_category_layered>
</layout>

However if you are using any layout updates inside your category configuration in admin side, it will overwrite this section and apply those layouts for those categories.

1

local.xml

Try this :

<?xml version="1.0"?>
<layout version="0.1.0">
<catalog_category_default>
  <reference name="root">
    <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
  </reference>
</catalog_category_default>
</layout>

Or page.xml

<block type="page/html" name="root" output="toHtml" template="page/3columns.phtml">

to

 <block type="page/html" name="root" output="toHtml" template="page/2columns-left.phtml">
1

For Check

Change product list page template in magento

If you need to set page template for all categories, you need to take into consideration of default categories as well as layered categories. Use local.xml file for this.

first we want to create local.xml file in your theme. in path like this

app\design\frontend\<your_package>\<your_theme>\layout\local.xml

and write below code.

<?xml version="1.0"?>
<layout version="0.1.0">
    <catalog_category_default>  <!-- for default categories -->
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
        </reference>
    </catalog_category_default>
    <catalog_category_layered> <!-- for layered categories  -->
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
        </reference>
    </catalog_category_layered>
</layout>

hello you can also set your template without create local.xml file

just change in page.xml file

<block type="page/html" name="root" output="toHtml" template="page/3columns.phtml">

to

<block type="page/html" name="root" output="toHtml" template="page/2columns-left.phtml">

This code is to change your page template in category list.

Also, you can change your participate category template.

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.