且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Magento-多次使用catalog/product_list块

更新时间:2023-11-30 13:54:46

似乎 catalog/product_send 块起到了作用-具有所有产品详细信息,并且没有涉及页面标题.>

I have a content slider I added, that shows selected products on my homepage and category pages. It's added using it's own xml layout file, and uses the catalog/product_list block to get the product information:

<reference name="root">
  <block type="catalog/product_list" name="content_slider">
    <action method="setTemplate">
        <template>content-slider.phtml</template>
    </action>
  </block>
</reference>

This all works fine, until you add more ways to sort your products in the category listings (such as by manufacturer) and then you get the error You cannot define a correlation name more than once seemingly becuse you can't use the catalog/product_list block twice. Changing the sliders block type to catalog/product_compare_list fixes this, but then the page title changes to Products Comparison List.

Is there some way to either extend the catalog/product_list block so it can be used more than once, or else some other block that can be used that holds all the product information, but won't affect my page title like the comparison one does?

Seems the catalog/product_send block does the trick - has all the product details and doesn't touch the page title.