0

现在。在 CMS 页面中,我使用以下代码:

{{block type="catalog/product_list" category_id="12" template="catalog/product/list.phtml"}}

在主页上。没问题。它可以显示类别 12 下的所有产品。但是现在。我想改变它的一些风格。所以我处理list.phtml文件以listhp.phtml使用

{{block type="core/templatet" category_id="12"  template="catalog/product/listhp.phtml"}}

没有任何产品展示。为什么?如何纠正它?谢谢你。

4

1 回答 1

0

Please change your code from:

{{block type="core/templatet" category_id="12"  template="catalog/product/listhp.phtml"}}

To:

{{block type="catalog/product_list" category_id="12"  template="catalog/product/listhp.phtml"}}

and everything will be fine, its because the method used in the template file like getLoadedProductCollection() are defined in the block Mage_Catalog_Block_Product_List which are called correctly when you set the block type to 'catalog/product_list'.
Also 'core/templatet' is not a valid block, it's 'core/template'.

于 2013-11-13T17:00:55.750 回答