In: HTML
9 Nov 2009Adding a new page layout in Magento is very simple. But why someone need to add a new page layout. Page layputs are already there.
Well, that can be needed specially for a Home page. One of my friend in manging the Home page with existing layout. If we do change in current layout, it would affect the other pages as well using the same layout.
So better way it to create a new layout.
[The steps below are updated to make it work with Magento 1.4 as well]
Steps:
1. Open the file: app/etc/modules/Mage_All.xml
Edit the <codePool > tag to ‘local’ such that it looks like:
true local
2. Copy config.xml
from app/code/core/Mage/Page/etc/config.xml
to app/code/local/Mage/Page/etc/config.xml
3. The file can be edited: app/code/local/Mage/Page/etc/config.xml
Add new lines between <layout> .. </layout> along with other layouts.
. . page/home.phtml . .page_home
2. Create new file : template/page/home.phtml along with 1column.phtml, 2columns-left.phtml etc.. You can just copy the existing code of one of the column layout phtml inside the home.phtml. Modify the code inside home.phtml as per your need.
3. On the Admin, Go To CMS -> Manage Pages. Edit the home page. Change the Layout to ‘Home’ under the ‘Custom Desing’ Tab.
This will apply the home.phtml to Home page.
Hello, Welcome to the Magento Coder.
I am Jignesh Patel, a Web Developer.
About Jignesh
4 Responses to Adding a new Page Layout to Magento
Lokanath
November 13th, 2009 at 5:36 am
Any need of Any One
Grant
January 16th, 2010 at 3:37 am
DON’T modify ANY files in app/code/core! Instead, copy the file you want to modify, in this case, config.xml, to app/code/local/Mage/Page/etc/config.xml
Notice the “local” code pool directory in path above. You simply recreate the identical directory stucture under the app/code/local directory. That way, after upgrading magento, your changes won’t be overwritten.
admin
March 7th, 2010 at 3:40 pm
@grant, I tried that on Magento 1.4 as well, but it does not work.
So I have to change the core code only. No other way !!
eL.
March 30th, 2010 at 12:04 am
u can do it this way, without modifying core code.
http://magentoexpert.blogspot.com/2010/01/magento-add-new-cms-page-layout.html