Change homepage to 1column.phtml in local.xml in new theme in Magento
Solution 1
you can simply do it without changing any core files:
- Login to admin panel
- Navigate to CMS->Pages
- Go to the Page named Home Page, click on it.
- On left hand panel go to the "Design " Tab
- Under Page layout column, choose 1 column
- Save
Please check the following image for more info:
Solution 2
When you edit any of the xml files you want to refresh the cache. This can be done by logging in to the admin and clicking system > cache management, then selecting all, and choosing refresh.
Alternatively you could disable all those caches while the project is in development. Same place, just a different option chosen.
EDIT
How about if you ignore the layout.xml and instead go to the magento admin to CMS>CMS Pages choose the home cms page, then go to design tab and put in the following
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
<remove name="left" />
<remove name="right" />
</reference>
<reference name="head">
<action method="addItem"><type>skin_js</type><name>js/script.js</name></action>
</reference>
Chandara Sam
Updated on June 18, 2022Comments
-
Chandara Sam almost 2 years
I am new to Magento. I want to develop theme in it. I start to create it by create CSS, JavaScript and add this files to it and it work. I want to change template file for home page to 1column.phtml that is located in
my_theme/default/template/page/1column.phtml
Here is my code in local.xml file
<?xml version="1.0" encoding="UTF-8"?> <layout> <!--default layout--> <default> <reference name="head"> <action method="addItem"><type>skin_css</type><name>css/style.css</name></action> </reference> </default> <cms_index_index> <reference name="root"> <action method="setTemplate"><template>page/1column.phtml</template></action> </reference> <reference name="head"> <action method="addItem"><type>skin_js</type><name>js/script.js</name></action> </reference> </cms_index_index> </layout>
But the result is used 3column.phtml as it default.
How can I set 1column.phtml to my Magento homepage?