2012-03-17 7 views
1

私のホームページにカスタムテンプレートを作成しました。私は、ファイルの下に作成しました:
1.アプリの/ etc /モジュール/ Test_Layout.xmlMagentoカスタムテンプレート

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

2.アプリ/コード/ローカル/テスト/レイアウトの/ 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./etc/modules/Mage-All.xmlにappしてそこにモジュールを追加します。
4.これらの後、私の新しいモジュールはsys-> config-> advanced-> advancedのリストにあり、
5. CMS->ページ - >デザイン - >カスタムレイアウト - >テストレイアウト & カスタムTHEME-> defualt /テスト(結果がドロップダウンリストに表示されます。)

6.Besideこれらの、私が設定した、カスタマーのレイアウト/ page.xml:

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

タイプについてはわかりません)
結果:Magentoは私のカスタムpage.xmlを使用しますが、ではが私のカスタムテンプレート "template/home.phtml"を使用せず、そのデフォルトテンプレートを使用します。
あなたは私を助けてくださいだろう - ?Thxを

+0

http://cmsblogheart.wordpress.com/2014/02/11/magento-custom-page-templates-using-xml/ –

答えて

1

Custom Design]タブを選択し、CMSのページでapp/etc/modules/Artlantis_page.xml

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

Artlantis_Page.xmlファイルを作成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> 

で​​3210を作成し、そこにレイアウトが表示されます、それを選択します。

+0

私はこれらを行っており、これらの部分に問題はありません。カスタムデザインで新しいレイアウトを選択すると、Magentoはこの新しいテンプレートを使用しません!どんな助け? –

+0

私のコードをチェックしましたか?あなたのコードとの違いがあります。私の方法を試してください、あなたは違いが表示されます。間違ったコードを忘れてしまいます。 –

+0

私はあなたのコードを使用しましたが、それは私を助けません。 –

関連する問題