Sunday, July 8, 2012

How to define custom layout in magento like 1column,2-column right,3-columns


template/page/2columns-aboutus.phtml
-----------------------------------------------------------------------
layout/page.xml
-----------------------------------------------------------------------
find All Two-Column Layout Pages (Left Column) and place
-----------------------------------------------------------------------
<page_two_columns_aboutus translate="label">
<label>All Two-Column Layout Pages (About us Column)</label>
<reference name="root">
<action method="setTemplate"><template>page/2columns-aboutus.phtml</template></action>
<!-- Mark root page block that template is applied -->
<action method="setIsHandle"><applied>1</applied></action>
</reference>
</page_two_columns_aboutus>
-----------------------------------------------------------------------
now define global object in xml
app/code/local/companyname/modulename/etc/config.xml
<two_columns_aboutus module="page" translate="label">
<label>2 columns with About Us</label>
<template>page/2columns-aboutus.phtml</template>
<layout_handle>page_two_columns_aboutus</layout_handle>
</two_columns_aboutus>
Now go to admin login pages/ -----> 2 columns with About Us

No comments:

Post a Comment

Please mention your comments.......