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 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
		
.
.
		

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.

View Comments + Add Comment

  • 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.

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

  • [...] 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 | [...]

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

  • 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.

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

  • Any need of Any One

Leave a comment

Spam Protection by WP-SpamFree

blog comments powered by Disqus