这是在local.xml中完成的方式
<catalog_category_layered>
<update handle="page_two_columns_left" />
<reference name="right">
<action method="unsetChild"><name>right.reports.product.viewed</name></action>
</reference>
<reference name="left">
<action method="unsetChild"><name>currency</name></action>
<action method="unsetChild"><name>catalog.leftnav</name></action>
<block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml"/>
<block type="reports/product_viewed" name="right.reports.product.viewed" template="reports/product_viewed.phtml" />
</reference>
</catalog_category_layered>
有谁知道为什么这不会出现在每个类别? Al类别是分层的(是锚点)。
答案 0 :(得分:1)
我从使用Magento 1.7的标签中了解到......根据:app/design/frontend/base/default/layout/reports.xml
<layout version="0.1.0">
<default>
<!-- Mage_Reports -->
<reference name="right">
<block type="reports/product_viewed" before="right.permanent.callout" name="right.reports.product.viewed" template="reports/product_viewed.phtml" />
<block type="reports/product_compared" before="right.permanent.callout" name="right.reports.product.compared" template="reports/product_compared.phtml" />
</reference>
</default>
<catalog_category_layered_nochildren translate="label">
<label>Catalog Category (Without Subcategories)</label>
<remove name="right.reports.product.viewed" />
<reference name="right">
<block type="reports/product_viewed" before="right.permanent.callout" name="left.reports.product.viewed" template="reports/product_viewed.phtml" />
</reference>
</catalog_category_layered_nochildren>
</layout>
所以,还有catalog_category_layered_nochildren
。