Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 2 of 2
Default Category layout: change to 2-column? 
 
quicksand14
Sr. Member
 
Total Posts:  150
Joined:  2010-09-30
 

Are you not supposed to put this in your local.xml located in your themes /layout directory?

I’m unclear if I am supposed to add like this:

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

or this:

15     <reference name="root">
 
16         <action method="setTemplate">
 
17             <template>page/2column.phtml</template>
 
18         </action>
 
19     </reference>

and am unclear if this should be looking at my /default or /base folder instead OR whether I need to duplicate these files into my own themes Page folder.

Anyone know?

 
Magento Community Magento Community
Magento Community
Magento Community
 
ceefour
Member
 
Avatar
Total Posts:  52
Joined:  2008-09-16
Bandung, Indonesia
 
quicksand14 - 30 March 2011 01:18 PM

Are you not supposed to put this in your local.xml located in your themes /layout directory?

Both ways is possible, but make sure to do it correctly. local.xml is always loaded for all pages, and you only can reference page layout handles, so you need to put the “setTemplate” mechanism for all pages that you want.

e.g. (the following will also work inside catalog.xml)

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

If you edit catalog.xml (i.e. copy from base then modify catalog.xml in your own theme) you can set use the “default” layout handle to apply to all Catalog pages (since catalog.xml is only loaded for catalog pages):

<default>
    <
reference name="root">
      <
action method="setTemplate">
        <
template>page/2column.phtml</template>
      </
action>
    </
reference>
  </default>
quicksand14 - 30 March 2011 01:18 PM

I’m unclear if I am supposed to add like this:

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

No, the above adds a new block, which is already existing. All you need to do is call the “setTemplate” method on root block with the page template that you want.

quicksand14 - 30 March 2011 01:18 PM

or this:

15     <reference name="root">
 
16         <action method="setTemplate">
 
17             <template>page/2column.phtml</template>
 
18         </action>
 
19     </reference>

and am unclear if this should be looking at my /default or /base folder instead OR whether I need to duplicate these files into my own themes Page folder.

The above one is correct, make sure to put it inside the desired layout handle.

The base/layout/catalog.xml contains its own examples:

<catalog_product_compare_index translate="label">
        <
label>Catalog Product Compare List</label>
        <!-- 
Mage_Catalog -->
        <
reference name="root">
            <
action method="setTemplate"><template>page/popup.phtml</template></action>
        </
reference>

<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>
 
Magento Community Magento Community
Magento Community
Magento Community
 
Heydarian
Member
 
Avatar
Total Posts:  69
Joined:  2009-05-11
Dallas, TX
 

Thanks nikefido, That saved me a lot of time too smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
Quijibo design
Jr. Member
 
Total Posts:  5
Joined:  2009-07-21
Beech Grove
 

on 1.5.1 you were a life saver thanks

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

 
Magento Community Magento Community
Magento Community
Magento Community
 
Unykvis
Jr. Member
 
Total Posts:  1
Joined:  2011-07-30
 

Hello I want to do something similar.

How can I set 3 columns in the CATEGORY view as default?

 
Magento Community Magento Community
Magento Community
Magento Community
 
bc28001
Jr. Member
 
Total Posts:  16
Joined:  2011-08-08
 

i want the same but my issue is that im not able to control it from the admin side
i dont want it to be fixed.
i want some page 1 colum other 2 colum and other 3 colum
i notice on the categories when im creating them there is an option for that. but for some reason is not working.
i have Magento ver. 1.6.0.0
is there an issue with it?
can you guys help me please.
thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
sourav the inventer
Jr. Member
 
Avatar
Total Posts:  27
Joined:  2010-06-11
India, Westbengal, Kolkata
 

Thanks ceefour your code is working fine.

 
Magento Community Magento Community
Magento Community
Magento Community
 
billytides
Jr. Member
 
Total Posts:  2
Joined:  2011-12-13
 

Thanks nikefido . Saved me a bunch of time and was just what I was looking for. Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
benyafai
Jr. Member
 
Total Posts:  1
Joined:  2012-01-23
 
ceefour - 21 January 2011 01:12 AM

PatrickTT - 25 November 2010 12:29 PM
nikefido, that doesn’t actually work for me… I have tried flushing the cache, but every time it is still 2 col with right bar. I would like it to be 2 col with left bar.

I copied page.xml into app/design/frontend/default/mytheme/page.xml and have also tried updating the base page.xml but neither seems to make a difference? Any clues as to what I might be doing wrong?

Add this inside < default > in your theme’s layout/catalog.xml :

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

Don’t forget to flush caches.

THANKS!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
joseph_gbim
Jr. Member
 
Total Posts:  4
Joined:  2012-04-18
 

Hey,

I want to add more details about each category on category page.
The detail would be different for each page how should i do dat?
Please help..

 
Magento Community Magento Community
Magento Community
Magento Community
 
lovey1
Jr. Member
 
Total Posts:  6
Joined:  2013-02-06
 

same

 
Magento Community Magento Community
Magento Community
Magento Community
 
SxOne
Jr. Member
 
Total Posts:  16
Joined:  2008-10-21
 

I’ve added this one line in both “Catalog Category (Non-Anchor)” and “..(Anchor)” and it works perfectly.

<update handle="page_two_columns_left" />

now it looks like this:

<label>Catalog Category (Non-Anchor)</label>
            <
update handle="page_two_columns_left" />
        <
reference name="root">
            <
action method="setTemplate"><template>page/2columns-left.phtml</template></action>
        </
reference>
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 2