2012-08-07 35 views
0

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

因此,当您浏览的类别分类,目录列表前面元素出现在这些顺序从上往下:

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

而且我想那为了改变这一个:

分类图像>分层Navigarion滤镜>产品的网格。

我试图修改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"/> 

... 

任何好的建议这个?

回答

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(); 
} 

亮点

$这个 - > getSortedChildren()

为此块将在你的内容块进行排序。您可以尝试使用前后声明进行订购。

例如:

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