Create New Layout In Magento

Magento comes in-built with a few page layouts like 1 column, 2 columns with left bar, 2 columns with right bar etc.
If you want to add new layouts of your own follow these steps.

1. Open file /app/etc/local.xml
2. Just before the </global&gt tag add the following






home_page



If you are using the latest version of Magento replace <cms> with <page>. I am not sure from which version this change was made. Just try both and any one will fit (as of now that is :P)

The above xml will do the following –
   a> Add a new layout whose template will be defined in file home-page.phtml using the <template> tag.
   b> The layout will be called homepage.
   c> The name displayed while choosing the layout from the backend will be ‘Home Page’ defined in the <label> tag.
   d> The handle of this page will be ‘home_page’ defined in the <layout_handle> tag.

3. Now create a file at \app\design\frontend\{package_name}\{theme_name}\template\page called home-page.phtml
4. Write the new template layout code in this file.

To make use of this layout –
1. Go to CMS->Manage Pages in the admin.
2. Open the CMS page you want this layout to be applied by clicking preview.
3. Choose ‘Custom Design’ from the left tab.
4. From the ‘Layout’ drop down choose ‘Home Page’

5 comments

  1. Dear Surai, Thank you for this wonderful blog of yours. Hope I could say much than Thank you. This topic saved my ass.

  2. Well said Surai,
    Magento Development has become the choice of many. We can avail a lot of benefits like robust open source platform, live currency update, search engine friendly, easy spreadsheet import and has complete shopping cart functionality in it.

    Magento Design UK

Leave a comment

Your email address will not be published. Required fields are marked *