Wednesday 24 September 2014

How to create Custom CMS Page Layout in Magento


How to create Custom CMS Page Layout in Magento

Here i am going to show you how to add new/custom CMS page layout..

Create Your Module File called Chand_Layout.xml in app/etc/modules

Insert the following code into the file:

<?xml version="1.0"?>
<config>
    <modules>
        <Chand_Layout>
            <active>true</active>
            <codePool>local</codePool>
        </Chand_Layout>
    </modules>
</config>


Now create Config file config.xml and put this file in app/code/local/Chand/Layout/etc/config.xml

Insert the following code into the file:

<?xml version="1.0"?>
<config>
<global>
<page>
<layouts>
<layout_home module="page" translate="label">
<label>Custom 2Columns</label>
<template>page/custom_2columns.phtml</template>
<layout_handle>custom_2columns</layout_handle>          
</layout_home>
</layouts>
</page>
</global>
</config>


Now you have to create Template File of your Module called custom_2columns.phtml and put this file in the below directory Structure.

app/design/frontend/default/YOUR_THEME/page/custom_2columns.phtml

Finally go to CMS->Pages->Home Page->Design. You can see your new Custom Layout in dropdown.

That's it enjoy Chandresh Rana Coding.. :)

No comments: