Nov
9
2009

Adding a new Page Layout to Magento

Adding a new page layout in Magento is very simple. But why someone need to add a new page layout. Page layouts are already there.

Well, that can be needed specially for a Home page. One of my friend faced many issues in managing the Home page with existing layout. As a result, he needed to write other codes as well to maintain the concurrency between other pages. 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
		
.
.
		

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 ‘Design’ Tab.

This will apply the home.phtml to Home page.

Related Posts

About the Author: Jignesh Patel

Jignesh Patel is a geek, an engineer & a web developer, who focus on developing web sites which look great, work great and can still work on older web browsers. Expertise in PHP, MySQL, JS, Magento & Wordpress.

  • http://www.webline.esmartweb.com Lokanath

    Any need of Any One

  • Grant

    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

    @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 !!

  • http://www.best4kids.pl eL.

    u can do it this way, without modifying core code.
    http://magentoexpert.blogspot.com/2010/01/magento-add-new-cms-page-layout.html

  • http://gouwu.org/web-design-and-development/magento-ecommerce-why-your-magento-hosting-company-matters.html Articles » Blog Archive » Magento Ecommerce – Why Your Magento Hosting Company Matters

    [...] Panel In Latest Version And Old …Magento: PHTML Files In Dreamweaver | Website Design BlogAdding a new Page Layout to Magento | Magento CoderMagento XML RPC API Invalid return payload: not-xmlrpc xml …Magento Powered | [...]

  • Anonymous

    The article above is updated to make it work with Magento 1.4 as well.

  • Guest

    This post is a bad example. Do not edit any Magento core files (including the Magento module xml files in app/etc/modules/. Learn how to create your own simple module to do this properly.

  • open-ecommerce.org

    this sample is not touching the core it is copying the file to the local and saying to search in local I don’t see any bad practice here

  • http://www.magento-themes.jextn.com magento themes

    I cant believe its that much easy.I am new in Magento. so, i need to learn a lot.Thanks for sharing.

  • http://www.mactonweb.com SEO bangalore

     I tried a lot for adding a new page but could not , thanks for sharing ,I found better after following this steps.

  • http://twitter.com/magefast Mage Fast
blog comments powered by Disqus