簡體   English   中英

無法覆蓋magento中的塊模板

[英]Cannot override block template in magento

我已經閱讀了很多文章,但是對我來說沒有任何作用。 任務很簡單-我需要用我自己的核心模板review / product / view / list.phtml覆蓋,例如my_list.phtml

我的配置如下。 Layout.xml(正在修改頭部)

<layout version="0.1.0">
<review_product_list>
    <reference name="head">
    ..
    </reference>
    <reference name="product.info">
        <block type="review/product_view_list" name="myreview.product_additional_data"
               as="myreview_product_additional_data" template="review/product/view/my_list.phtml"/>
    </reference>
</review_product_list>

Config.xml

 <frontend>
    <layout>
        <updates>
            <myreview>
                <file>myreview/layout.xml</file>
            </myreview>
        </updates>
    </layout>
</frontend>

我可以更改核心文件review.xml,它可以按預期工作,此行

<block type="review/product_view_list" name="product.info.product_additional_data" as="product_additional_data" template="review/product/view/list.phtml">

但這不是我期望的。

如果將引用名稱=“ product.info”更改為引用名稱=“ content”,則會顯示我的模板,但位置不正確。 如果我嘗試調試,則呈現塊。

<review_product_list>
    <reference name="product.info.product_additional_data">
        <action method="setTemplate">
            <tpl>review/product/view/my_list.phtml</tpl>
        </action>
    </reference>
</review_product_list>

要么

<review_product_list>
    <action method="setTemplate" block="product.info.product_additional_data">
        <tpl>review/product/view/my_list.phtml</tpl>
    </action>
</review_product_list>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM