在类别图像后移动分层导航过滤器

时间:2012-08-07 07:27:38

标签: xml magento layout layered-navigation

我正在使用Magento v.1.6.2.0。我已将“类别”分层导航过滤器设置为在我的网站中水平显示并使用1列页面布局。我还设置了一个类别图像。

因此,当您导航到该类别类别时,目录列表前面元素将按照从上到下的顺序显示:

分层导航过滤器>分类图像>产品网格。

我想把这个顺序改为这个:

分类图像>分层导航滤波器>产品网格。

我试图修改catalog.xml文件,但我无法使其工作:

 ...
 <catalog_category_layered translate="label">
        <label>Catalog Category (Anchor)</label>
        <reference name="left">
            <block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml"/>
        </reference>
        <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">
                    <!-- <action method="addReviewSummaryTemplate"><type>default</type><template>review/helper/su.phtml</template></action> -->
                    <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"/>

 ...

对此有什么好的建议吗?

1 个答案:

答案 0 :(得分:0)

所有这些块在内容块中都有消息,这是Mage_Core_Text_List类型并在其内容中对块进行排序。您可以在下一个函数中看到此行为:

protected function _toHtml()
{
    $this->setText('');
    foreach ($this->getSortedChildren() as $name) {
        $block = $this->getLayout()->getBlock($name);
        if (!$block) {
            Mage::throwException(Mage::helper('core')->__('Invalid block: %s', $name));
        }
        $this->addText($block->toHtml());
    }
    return parent::_toHtml();
}

高亮

<强> $这 - &GT; getSortedChildren()

因此,将在您的内容块中对该块进行排序。您可以尝试在声明之前和之后订购。

例如:

<block .... as="layered" after="category.image"/>
<block .... as="category.image" before="-"/>
<block .... as="grid.product after="layered"/>
相关问题