2014-10-01 81 views
0

我試圖將自定義phtml文件輸出到我的Magento網站的標題。以下是我所做的更改: 是否有任何理由不對我工作?什麼都沒有輸出Magento 1.9.0.1 - 將自定義phtml添加到標題

local.xml中

<reference name="head"> 
    <block type="core/text" name="wc-how-to" template="wc-how-to.phtml"/> 
    <!-- <block type="core/text" name="wc-how-to" template="wc-how-to.phtml" output="toHtml"/> --> 

</reference> 

WC-如何-to.phtml

<div class="wc-how-to"> 
This is some test text 
</div> 

header.phtml

echo $this->getChildHtml('wc-how-to'); 
+0

我愛的人誰投降我很清楚的問題倒沒有明顯的原因。來這裏,我會給你一個有用的吻。 – aDvo 2014-10-01 09:38:34

回答

2

請檢查引用名。它應該是標題和□不

<reference name="header"> 
    <block type="core/text" name="wc-how-to" template="wc-how-to.phtml"/> 
    <!-- <block type="core/text" name="wc-how-to" template="wc-how-to.phtml" output="toHtml"/> --> 

</reference> 
+0

也type =「核心/文本」沒有工作,但「核心/模板」沒有 謝謝! – aDvo 2014-10-01 15:15:17

+0

錯過了那部分。很高興知道你發現了! – 2014-10-06 10:43:24

相關問題