tags:

views:

34

answers:

1

I want to use a customized template file for magento homepage. I used the following code in the layout/local.xml file of my theme as described in this tutorial

<new_layout translate="label">
    <label>New Layout</label>
    <reference name="root">
        <action method="setTemplate"><template>page/home.phtml</template></action>
        <!-- Mark root page block that template is applied -->
        <action method="setIsHandle"><applied>1</applied></action>
    </reference>
</new_layout>

But the template path hint shows page/3columns.phtml. Anybody please specify the exact way to set a one template to the homepage and another to the products page.Also want to remove the Cart and compare boxes only from the sidebar of the homepage and show it in other pages.I am using magento 1.4.1

+1  A: 

Your problem is in the way that you are specifying the page you want to change. The homepage is a CMS page, so you should edit the layout by editing the specific CMS page. From there you can change to a different page type and add or remove blocks at will.

If you want to change the layout of the catalog view page, you'll want to edit the tag <catalog_product_view>, which you can reference in catalog.xml. So change your code to something like this:

<catalog_product_view>
    <reference name="root">
        <action method="setTemplate"><template>page/home.phtml</template></action>
        <!-- Mark root page block that template is applied -->
        <action method="setIsHandle"><applied>1</applied></action>
    </reference>
</catalog_product_view>
Joseph Mastey
thanks for the reply ,Do you have a good tutorial for magento modification.All the docs in the magentocommerce site are confusing.Also I came across another problem. The number of records in the URL rewrite management getting multiplied when i change the category name or static page url. I have only 20 products and 10 static pages , and the URL rewrite management records is greater than 500. I think it is slowing down the site. Is there any fix for this? or do i have to clear the database table ?
Sreejith