2013-04-01 24 views
1

塊,如果我有Magento的 - 添加使用local.xml中

app\design\frontend\base\default\template\dir\template.phtml 

看起來像這樣

<div class='block block-list'> 
    <div class='block-title'><strong><span>Some Block</span></strong></div> 
     <div class='block-content'> 
      &nbsp;<?php echo "my content"; ?> 
     </div> 
    </div> 

我怎樣才能顯示它使用local.xml中一個分類頁面上的模板?不應該這個代碼工作?

<?xml version="1.0"?> 
<layout version="0.1.0">  
    <default>     
     <reference name="right"> 
     <block type="core/template" 
      name="somename" 
      template="dir/template.phtml" /> 
     </reference> 
    </default> 
</layout> 
+0

你是什麼意思目錄頁 –

回答

1

我想你不能有自定義佈局處理<catalog_category_default translate="label">默認佈局內把手<default> 糾正我,如果我錯了。

+0

這是指Palanikumar發佈的評論。 – ANKIT

+0

你似乎是正確的。我刪除了「默認」標籤,並按預期工作。 –

0

您必須在該引用標籤前使用模板引用名稱。

<?xml version="1.0"?> 
<layout version="0.1.0">  
    <default> 
    <catalog_category_default translate="label">     
     <reference name="right"> 
     <block type="core/template" 
      name="somename" 
      template="dir/template.phtml" /> 
     </reference> 
    </catalog_category_default> 
    </default> 
</layout> 
+0

你是正確的,但正如ANKIT指出,默認標籤必須去。 –

相關問題