8

I am new to magento learning. can some one please guide me how to change product view page to 1 column layout. I am using magento default theme.

Thanks

6 Answers 6

26

To change product view page to 1 column layout you need to open

app/design/frontend/default/default/layout/catalog.xml

Reach to following Code :

<catalog_product_view translate="label">
    <label>Catalog Product View (Any)</label>
    <!-- Mage_Catalog -->
    <reference name="root">
        <action method="setTemplate"><template>page/2columns-right.phtml</template>
        </action>
    </reference>

Here you can change 2columns-right.phtml to 1column.phtml.

We can also use local.xml(better way) and the following code need to be added -

<catalog_product_view>
    <reference name="root">
        <action method="setTemplate"><template>page/1column.phtml</template></action>
    </reference>
</catalog_product_view>

Hope it'd be helpful.

Thanks!

2
  • If this is correct answer why has it not been accepted as such Aug 31, 2012 at 20:17
  • 6
    Hi Marty and all... This not the correct answer as it means overwriting a core layout file. The correct answer is to "adjust" the layout for "catalog_product_view" in a local.xml, specifiy minmal xml layout which will be more compatible with future versions of Magento as you upgrade. "The Magento Way" See below...
    – Flipmedia
    Sep 21, 2014 at 18:45
10

I would not recommend any of those answers!

Your magento is going to break with any update!

The only good answer when you need to update any xml layout is to edit the file local.xml located in app/design/frontend/youtheme/default/layout

Simply add

<catalog_product_view translate="label">
    <label>Catalog Product View (Any)</label>
    <!-- Mage_Catalog -->
    <reference name="root">
        <action method="setTemplate"><template>page/2columns-left.phtml</template>
        </action>
    </reference>
</catalog_product_view>

And you're done... easy and clean.

10

All of the above answers are not The Magento Way.

In your local.xml file for your theme add:

<catalog_product_view>
    <reference name="root">
        <action method="setTemplate"><template>page/1column.phtml</template></action>
    </reference>
</catalog_product_view>
1
  • This is the correct answer as it resolves the question of how to set the layout to a 1 column layout.
    – Flipmedia
    Sep 21, 2014 at 18:46
6

An easier approach if needed is Set the custom layout of the Product to 1-column

Steps:

  1. Go to Admin->Catalog->Manage Products

  2. Select all products and choose update attribute from the Action drop-down on the top-right of the grid and click on the submit.

  3. Now search for Page Layout drop-down and set the desired layout (1 column)

If you need to do this for each product then inside for updating for all the products at once just need to edit each product and inside the "Design" tab set the "Page Layout" to whatever is required.

that's it

Hope this helps!!

2
  • 1
    If you have 200,000 products in your catalog, this would add 200,000 rows to the database (at least), wouldn't it? Wouldn't it be better to just update the xml? Nov 1, 2014 at 0:18
  • If you have 200,000 products in your catalog then there is already 200,000 entries in the database, so it will only update the values and not add any extra entry in the database. Also, adding in xml is also a solution. Jul 30, 2015 at 6:33
2
public function indexAction(){

    //Get current layout state 
    $this->loadLayout();

    $this->getLayout()->getBlock('root')->setTemplate('page/1column.phtml');

    $block = $this->getLayout()->createBlock(
        'Mage_Core_Block_Template',
        'thecardshop_customisecard_viewer',
        array('template' => 'customisecard/viewer.phtml')
    );

    $this->getLayout()->getBlock('content')->insert($block);

    $this->renderLayout();
}
1
  • 1
    It's supposed to be a bad habit to use promotions in questions and answers on SO. Please put your links into your profile. May 9, 2013 at 8:16
2

Most simple and fast method is

UPDATE `catalog_product_entity_varchar` SET `value` = 'one_column'
WHERE `value` = 'two_columns_left'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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