Reputation: 7778
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
Upvotes: 8
Views: 50475
Reputation: 21
Most simple and fast method is
UPDATE `catalog_product_entity_varchar` SET `value` = 'one_column'
WHERE `value` = 'two_columns_left'
Upvotes: 2
Reputation: 1293
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!
Upvotes: 26
Reputation: 156
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>
Upvotes: 10
Reputation: 299
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.
Upvotes: 10
Reputation: 269
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();
}
Upvotes: 2
Reputation: 908
An easier approach if needed is Set the custom layout of the Product to 1-column
Steps:
Go to Admin->Catalog->Manage Products
Select all products and choose update attribute from the Action drop-down on the top-right of the grid and click on the submit.
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!!
Upvotes: 6