jcadima
3/30/2015 - 2:58 PM

Creating a custom magento template

Creating a custom magento template

<!--
In order to make it appear in the layout dropdown you need to create a custom module (you can also add something in a core file but please don't do that). Let's name the extension Easylife_Layout. For this you need to create the following files: app/etc/modules/Easylife_Layout.xml - the declaration file-->

<?xml version="1.0"?>
<config>
    <modules>
        <Easylife_Layout>
            <active>true</active>
            <codePool>local</codePool>
            <depends>
                <Mage_Page />
            </depends>
        </Easylife_Layout>
    </modules>
</config>



<!--

app/code/local/Easylife/Layout/etc/config.xml - the configuration file

-->
<?xml version="1.0"?> 
<config>
    <modules>
        <Easylife_Layout>
            <version>0.0.1</version>
        </Easylife_Layout>
    </modules>
    <global>
        <page>
            <layouts> 
                <lookbook module="page" translate="label">
                    <label>EnterTemplateNameHere</label>
                    <template>page/1column-lookbook.phtml</template>
                    <layout_handle>lookbook</layout_handle>
                </lookbook> 
            </layouts>
        </page>
    </global>
    <frontend>
        <layout>
            <updates>
                <easylife_layout>
                    <file>easylife_layout.xml</file>
                </easylife_layout>
            </updates>
        </layout>
    </frontend>
</config>



<!--
app/design/frontend/{interface}/{theme}/layout/easylife_layout.xml - the layout file
This last one is necessary in case you want to be able to reference your custom layout in layout files. Something like:
<update hande="lookbook" />
-->
<?xml version="1.0"?> 
<layout>
    <lookbook translate="label">
        <label>Lookbook</label>
        <reference name="root">
            <action method="setTemplate"><template>page/1column-lookbook.phtml</template></action>
            <action method="setIsHandle"><applied>1</applied></action>
        </reference>
    </lookbook> 
</layout>
http://magento.stackexchange.com/questions/1140/magento-1-7-adding-custom-layouts-for-cms-and-category-use-with-custom-module-tr