Magento:在local.xml中更改块模板

时间:2012-08-07 05:41:58

标签: magento

我希望产品评论页面使用不同的模板而不是:

目录/产品/ view.phtml

review.xml 中,我看到正在调用的文件:

<block type="review/product_view" name="product.info" template="catalog/product/view.phtml">

有没有办法可以在local.xml中覆盖它并创建一个新文件(例如:view2.phtml)并将其用于此页面?

2 个答案:

答案 0 :(得分:7)

<review_product_list>
    <reference name="product.info">
        <action method="setTemplate"><template>catalog/product/view2.phtml</template></action>
    </reference>
</review_product_list>

答案 1 :(得分:1)

是的,您可以通过在local.xml中编写以下代码来实现这一点: -

<reference name="product.info">
    <action method="setTemplate"><template>catalog/product/view2.phtml</template></action>
</reference>

此处view2.phtml是适当文件夹结构中的新文件。

希望它有所帮助。

相关问题