2012-08-07 75 views
0

我想商品評論頁面使用不同的模板,而不是:Magento的:在local.xml中更改塊模板

目錄/產品/ view.phtml

review.xml,我看到文件被稱爲:

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

有沒有一種方法,我可以覆蓋在local.xml中,並創建一個新的文件(例如:view2.phtml),並使用此頁?

回答

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

工作很好,謝謝! – callmedpit 2012-08-07 06:28:45

1

是的,你絕對可以做到這一點在local.xml寫下面的代碼: -

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

這裏view2.phtml是正確的文件夾結構中的新文件。

希望它有幫助。