我在产品视图页面的布局内容块中显示相关产品.我在catalog.xml中的代码是:
<reference name="content">
<block type="catalog/product_list_related" name="catalog.product.related" after="-" template="catalog/product/list/related.phtml"/>
</reference>
Run Code Online (Sandbox Code Playgroud)
现在,所有相关产品都显示在我的产品视图页面中,但我只想显示3个产品,我该怎么办?拜托,有人可以帮忙吗?
我创建了一个包含一些内容的表,其中有12行和2列.我想显示边框,但每隔4行后,我想设置比正常厚的水平边框.怎么做?请帮忙.
我在getToolbarHtml()之后调用list.phtml文件中新创建的引用.但它没有显示任何东西.我的catalog.xml文件类似于:
<reference name="content">
<block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
<block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
<block type="page/html_pager" name="product_list_toolbar_pager"/>
<!-- The following code shows how to set your own pager increments -->
<!--
<action method="setDefaultListPerPage"><limit>4</limit></action>
<action method="setDefaultGridPerPage"><limit>9</limit></action>
<action method="addPagerLimit"><mode>list</mode><limit>2</limit></action>
<action method="addPagerLimit"><mode>list</mode><limit>4</limit></action>
<action method="addPagerLimit"><mode>list</mode><limit>6</limit></action>
<action method="addPagerLimit"><mode>list</mode><limit>8</limit></action>
<action method="addPagerLimit" translate="label"><mode>list</mode><limit>all</limit><label>All</label></action>
-->
</block>
<reference name="newreference">
<block type="core/template" name="newreferenceblock" template="newreference.phtml" />
</reference>
<action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
<action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
<action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
<action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
<action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
<action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
</block>
</block>
Run Code Online (Sandbox Code Playgroud)
我在引用内部调用引用,事情是我想创建自己的侧边栏.那有什么问题呢?在list.phtml中,我通过以下方式调用我的引用:
<?php echo $this->getChildHtml('newreference') ?>
Run Code Online (Sandbox Code Playgroud)
请帮我.