Magento 1.8 – How to Set 2 Columns Left on Any Page

categorycolumnmagento-1.8

So this is it. I want to set the 2columns-left to any page of Magento. Not even 1 1column.
I want to do this because I've just installed a plugin which adds the category navigation on the left column and I want to see the categories from any place.
I've tried editing local.xml like this:

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

But with no total success. I can see the left column but it's not placed on the left of the col-main but inside, at the end of the information of product view.

EDIT:

<div class="main">
    <?php echo $this->getChildHtml('breadcrumbs') ?>
    <div class="col-main">
        <?php echo $this->getChildHtml('global_messages') ?>
        <?php echo $this->getChildHtml('content') ?>
    </div>
    <div class="col-left sidebar">
        <?php echo $this->getChildHtml('left') ?>
        <?php echo $this->getChildHtml('custom_left_block1') ?>
        <?php echo $this->getChildHtml('custom_left_block2') ?>
        <?php echo $this->getChildHtml('custom_left_block_clean1') ?>
        <?php echo $this->getChildHtml('custom_left_block_clean2') ?>
        <?php echo $this->getChildHtml('custom_left_block3') ?>
        <?php echo $this->getChildHtml('custom_left_block4') ?>
    </div>
</div>

2columns-left seems correct. In fact, it shows up correctly to any page. It's only on the catalog product view where it looks diferent. So it's not either something related to css, if I'm not wrong.

EDIT 2:

<?xml version="1.0"?> 
<layout version="0.1.0">
    <default>
        <remove name="sale.reorder.sidebar"/>
    </default>


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

    <!--All Cms Pages-->
    <cms_page>
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
        </reference>
    </cms_page>

    <!--Category View-->
    <catalog_category_view>
        <!--Set Page Template-->
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
        </reference>
    </catalog_category_view>

    <!--Category View With Layered Navigation-->
    <catalog_category_layered>
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
        </reference>
    </catalog_category_layered>

    <!--Onepage Checkout Index Page-->
    <checkout_onepage_index>
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
        </reference>
    </checkout_onepage_index>

    <!--Onepage Checkout Success Page-->
    <checkout_onepage_success>
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
        </reference>
    </checkout_onepage_success>

    <!--Customer Accound Pages-->
    <customer_account>
        <!--Adds Body Class For All Dashboard Pages - MUST when Dashboard is present-->
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
        </reference>
    </customer_account>

    <!--Customer Logged In-->
    <customer_logged_in>
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
        </reference>
    </customer_logged_in>

    <!--Customer Logged Out-->
    <customer_logged_out>
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
        </reference>
    </customer_logged_out>

    <!--Product View-->
    <catalog_product_view>
        <!--Product Information Block-->
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
        </reference>
    </catalog_product_view>

    <!--Catalogsearch Result Page-->
    <catalogsearch_result_index>
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
        </reference>
    </catalogsearch_result_index>

    <!--Advanced Search Result Page-->
    <catalogsearch_advanced_result>
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
        </reference>
    </catalogsearch_advanced_result>

    <!--Advanced Search Page-->
    <catalogsearch_advanced_index>
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
        </reference>
    </catalogsearch_advanced_index>

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

    <!--Contacts Page-->
    <contacts_index_index>
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
        </reference>
    </contacts_index_index>
</layout>

This is my entire local.xml. I can see the left column at the left side but it seems that <?php echo $this->getChildHtml('left') ?> doesn't load the navigation menu on all pages, only some. And I still see the left-column inside of the main-column on catalog_product_view.

SOLUTION:

If the left or right column isn't placed where it should but only in some specific pages it's because there are some not closed divs on that specific phtml. It was view.phtml in my case.

I've also found out the solution for the fact that in some pages the <?php echo $this->getChildHtml('left') ?> didn't show up. It's because, for example, in customer.xml there was a <remove name="left"/> and any change i made on my local.xml to <default> didn't apply. It was overwritten my local.xml.

Best Answer

Lets debug, in view.phtml please add below code for getting template

$this->getLayout()->getBlock('root')->getTemplateFile();

If it given value ...page/2columns-left.phtml then the template file properly applied at your theme.Then at any where force full set template for product details page. and you need to check all layout files,.

Also it give proper result then you can to set 2columns-left.phtml to all pages by using handler as default <default></default>.

<default> <!-- this handler is called  on all pages -->
    <reference name="root">
        <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
    </reference>
</default>
Related Topic