megwoo
6/25/2015 - 7:23 PM

Magento Add Layout or Template

1. Create new folder structure:
/app/code/local/Alliance/AddTemplates/etc/config.xml

Put this in the config:

<?xml version="1.0"?>
<config>
  <modules>
    <Alliance_AddTemplates>
      <version>0.1.0</version>
    </Alliance_AddTemplates>
  </modules>
  <global>
    <page>
      <layouts>
        <Home_Page translate="label">
          <label>Home Page</label>
          <template>page/home-page.phtml</template>
          <layout_handle>Home_Page</layout_handle>
        </Home_Page>
        <!-- add more layouts here -->
      </layouts>
    </page>
  </global>
</config>


2. Add module:
/app/etc/modules/Alliance_AddTemplates.xml

Content for Alliance_AddTemplates.xml:
<?xml version="1.0"?>
<config>
  <modules>
    <Alliance_AddTemplates>
      <active>true</active>
      <codePool>local</codePool>
      <depends>
        <Mage_Page />
      </depends>
    </Alliance_AddTemplates>
  </modules>
</config>


3. Add template here:
/app/design/frontend/rwd/ouidad/template/page/home-page.phtml