2012-02-23 17 views
1

ページにカスタムブロックを追加する必要があります。どこにいても問題ありません。ここではこの例にMagentoのlocal.xmlからブロックを追加

<customer_account_index translate="label"> 
     [code] 
     <reference name="my.account.wrapper"> 
      [code] 
     </reference name="my.account.wrapper"> 
    </customer_account_index> 

私のコードはにローカルである。この例では、私はこのパスを参照してくださいcustomer.xmlをに見て、そう/ 顧客/アカウントに

をそれをしたいです。それが表示されないため、XML

<customer_account_index> 
    <reference name="my.account.wrapper"> 
     <block type="core/template" 
      name="customer_groupsprogressbar"   
      template="customer/groupsprogressbar.phtml" /> 
    </reference> 
    </customer_account_index> 

何かが、間違っています。そのブロックをcustomer.xmlに追加すると、すべて正常に動作します。

ここで間違っていることの手がかりはありますか?

+0

?あなたはファイルへの完全なパスを与えることができますか?テンプレートからの – Alex

+0

local.xml。 app/design/frontend/default/THEME/layout/layout.xml – Ovidiu

+0

システム - >設定 - >デザインをチェックしてください。デフォルトにする必要があります。 –

答えて

3

は試してみてください

<customer_account_index> 
    <reference name="my.account.wrapper"> 
     <block 
      type="core/text_list" 
      name="customer_groupsprogressbar"   
      template="customer/groupsprogressbar.phtml" /> 
    </reference> 
</customer_account_index> 

またはmy.account.wrapperテンプレートで

<customer_account_index> 
    <reference name="my.account.wrapper"> 
     <block 
      type="core/template" 
      name="customer_groupsprogressbar"   
      template="customer/groupsprogressbar.phtml" output="toHtml" /> 
    </reference> 
</customer_account_index> 

OR :

あなたが話しているlocal.xml
<?php echo $this->getChildHtml('customer_groupsprogressbar'); ?> 
+0

申し訳ありませんが、私はに 'as'を配置する必要があることを知りたいですか? – Kamal

+1

これは必須ではありません。別名です。あなたが getChildHtml( 'a_b')または$ this-> getChildHtml( 'a.b')のように呼び出すことができます。

+0

@ JevgeniSmirnov最初と2番目は動作していません。 3番目のオプションが機能している可能性がありますが、必要なものではありません。テンプレートファイルを変更せずに、必要な場所に移動できるようにするには、xmlファイル内のこのブロックを必要とします。 – Ovidiu

関連する問題