Magento-多次使用catalog/product_list块 [英] Magento - using the catalog/product_list block more than once

查看:64
本文介绍了Magento-多次使用catalog/product_list块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我添加了一个内容滑块,该滑块在我的主页和类别页面上显示选定的产品.它使用自己的xml布局文件添加,并使用 catalog/product_list 块获取产品信息:

 <参考名称="root"><阻止type ="catalog/product_list" name ="content_slider">< action method ="setTemplate">< template> content-slider.phtml</template></action></block></reference> 

这一切都很好,直到您添加了更多在类别列表中对产品进行排序的方式(例如按制造商),然后出现错误您似乎不能多次定义关联名称因为您不能两次使用 catalog/product_list 块.将滑块块类型更改为 catalog/product_compare_list 可以解决此问题,但是页面标题将更改为产品比较列表.

是否可以通过某种方式扩展 catalog/product_list 块,以便可以多次使用它,或者可以使用其他一些块来保存所有产品信息,但不会不会像比较中那样影响我的页面标题?

解决方案

似乎 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.

这篇关于Magento-多次使用catalog/product_list块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆