在我的local.xml文件中,我有標記來覆蓋產品目錄頁面。在麪包屑之前的2columns-left.phtml裏面,我想創建具有動態產品類別標題的自定義類別塊,以及取決於類別名稱的描述和背景顏色。Magento - 將自定義的phtml塊注入2columns-left.phtml不起作用
問題是我的自定義塊沒有出現。 local.xml中:
<catalog_category_view>
<reference name="root">
<action method="setTemplate">
<template>page/2columns-left.phtml</template>
</action>
<block type="core/template" name="big_header" before="content" template="boilerplate/page/html/head/big_header.phtml" />
</reference>
</catalog_category_view>
樣板/頁/ HTML /頭/ big_header.phtml:
<h1>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</h1>
當我將此塊添加到: <reference name="head">
內容從big_header.phtml顯示正常。
我使用Magento的1.7
謝謝你的工作解決方案。蘇曼先生,我有最後一個問題。如何在breadcrumb之前只在catalog_category_view上添加自定義塊? http://prntscr.com/dgx5o7 –