How can we add new layout in magento?


If you want to add new layout file in magento, go to app/code/core/Mage/page/etc/config.xmland then add new template element between <page><layouts> tag.

<layouts>
<NAME_FOR_YOUR_NEW_LAYOUT translate="label">
<label>LAYOUT_NAME</label>
<template>page/layout_file_name.phtml</template>
<layout_handle>layout_handle</layout_handle>
</NAME_FOR_YOUR_NEW_LAYOUT>
</layouts>

 

check below code if you want to add new template in your own module.

If you want to create a new layout file for particular module, such as you have create a module for your home page and it will be needed different design left pages.

Now you need to add some lines for that and then you can see your template file in cms side so you select your home page module from layout drop down field.

now check have you added element in your xml file

now add this below code

<global>
<page>
<layouts>
<NAME_FOR_YOUR_NEW_LAYOUT translate="label">
<label>LAYOUT_NAME</label>
<template>page/layout_file_name.phtml</template>
<layout_handle>layout_handle</layout_handle>
</NAME_FOR_YOUR_NEW_LAYOUT>
</layouts>
</page>
</global>

Now you can see your new layout file in CMS page in layout drop down filed.

for more information

http://www.magentocommerce.com/wiki/4_-_themes_and_template_customization/0_-_theming_in_magento/adding_cms_layout_templates

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s