我試圖在產品視圖(僅)產品詳細信息頁面中將模板塊添加到我的頁腳塊中。我試着在catalog.xml中佈局文件下面,但沒有運氣:爲模塊動態添加模板塊
<catalog_product_view translate="label">
...
<reference name="footer">
<block type="core/template" name="uniqueName" template="catalog/product/mytemplate.phtml" />
</reference>
</catalog_product_view>
和
<catalog_product_view translate="label">
...
<reference name="footer">
<block type="core/template" name="uniqueName">
<action method="setTemplate"><template>catalog/product/mytemplate.phtml</template></action>
</block>
</reference>
</catalog_product_view>
我能夠用後一種方法把模板塊成塊content
同樣的方式,<reference name="content">
,所以我不明白爲什麼這是行不通的。這似乎是我沒有正確引用頁腳..我看到在page.xml文件中創建的頁腳添加爲<block type="page/html_footer" name="footer" as="footer" template="page/html/footer.phtml">
。有人可以幫我解決這個問題嗎?非常感激!
你在哪裏回聲$這個 - 調用>,直到最底層(「uniqueName」)? – pspahn
是的,我其實只是注意到這是我的問題。頁腳模板不調用'$ this-> getChildren();'.. –
就像我假設的那樣>< –