1
votes

I have made a custom template for my home page. I have created below files:
1. app/etc/modules/Test_Layout.xml

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

2. app/code/local/Test/Layout/etc/config.xml

<?xml version="1.0"?>
<config>
  <modules>
    <Test_Layout>
      <version>0.1.0</version>
    </Test_Layout>
  </modules>
<global>  
 <page>
   <layouts>
    <test_layout translate="label">
      <label>Test Layout</label>
      <template>page/home.phtml</template>
      <layout_handle>page_home</layout_handle>
    </test_layout>
   </layouts>
  </page>
</global>
</config>

3. app/etc/modules/Mage-All.xml and add my module there.
4. After these things, my new module is in the list of sys->config->advanced->advanced, and
5. then I set CMS->Pages->Design->Custom Layout-> Test Layout & Custom Theme-> defualt/test (The result appears in the drop-down lists.)

6.Beside these, I have set custome layout/page.xml:

<block type="page/html" name="root" output="toHtml" template="page/home.phtml">

(I am not sure about the type)
Result: Magento use my custom page.xml but it does not use my custom template "template/home.phtml" and use its default template.
Would you please help me?--Thx

1

1 Answers

1
votes

create config.xml in app/code/local/Artlantis/Page/config.xml

<?xml version="1.0" encoding="utf-8"?>
<config>
<modules>
    <Artlantis_Page>
    <version>0.1.0</version>
    </Artlantis_Page>
</modules>
<global>
    <page>
    <layouts>
        <custom_cms module="page" translate="label">
        <label>Custom Home Page</label>
        <template>page/custom-home.phtml</template>
        <layout_handle>custom_home_page</layout_handle>
        </custom_cms>
    </layouts>
    </page>
</global>
</config>

create Artlantis_Page.xml file in app/etc/modules/Artlantis_page.xml

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

In CMS page, select Custom Design tab and you will see your layout in there, select it.