How to create new template Magento

How to create new template Magento

Written by  Face4store

You may find that you want to add additional layout template options to the CMS section that can be chosen when creating or editing a page in the admin interface.

Step 1: Create New Template

Create a new template file in the following directory (you may want to simply copy an existing template, such as 1column.phtml) and name it with an appropriate name (ie: home.phtml if that template will be used for your home page).


whereas YOUR_INTERFACE typically remains "default" and YOUR_THEME can also be "default" (please see Design-Guide about proper naming of themes and interfaces)

Step 2: Create a new module

In order to customize the configuration of Magento without hacking into existing files we need to create a new module. This is very simple. The module will only contain a configuration file that updates the section that lists the available templates for the CMS.

We'll call the module Banana (just a example) and its package name Fruit (also just an example).

Note: You may (and probably should) choose a different module/package name, just be consistent throughout the process.

We need to tell Magento about our new module, so create a new file:


with the following content:

<?xml version="1.0"?>







<Mage_Page />





Now we need to actually create the module itself. Create the following file (and the neccessary folder structure):


with the following content:

<?xml version="1.0"?>















<!-- add more layouts here -->





The capitalized parts need to be filled in by you.

Any new layouts you want to add should to be in the following format:

<layout_description translate="label">

<label>Layout Name</label>


<!-- defining the layout handle is optional -->


Using the same steps, and modifying them for each template, you can create new layout templates for use on any CMSpage.

You're done!

Also, take a look at the config.xml of the Page module in the Mage package; it defines the layouts that come with Magento:


On line ~47(version find:



<empty module="page" translate="label">





<one_column module="page" translate="label">

<label>1 column</label>





<two_columns_left module="page" translate="label">

<label>2 columns with left bar</label>




<two_columns_right module="page" translate="label">

<label>2 columns with right bar</label>




<three_columns module="page" translate="label">

<label>3 columns</label>






If you don't care for updating Magento and love hacking core files (something you generally shouldn't do, unless you know what you're doing) you can also just update this file (app/code/core/Mage/Page/etc/config.xml). Beware though that Magento updates can override the changes you've made.

From magentocommerce -  Themes and template customization - Magento

Related items

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.