Magento:更改左列中块的顺序

时间:2013-08-05 18:57:37

标签: xml magento magento-1.7

我在改变Magento左栏中的块顺序时遇到了令人沮丧的问题。我想按以下顺序在左栏中显示三个块:

1)标题为block_left_top的块 2)标题为block_left_social_icons的块 3)传统上在右栏中的比较产品块

在我的local.xml文件中,我完成了以下操作:

将比较移出右栏

<reference name="right"><action method="unsetChild"><name>catalog.compare.sidebar</name></action></reference> 

将两个静态块添加到左列并将比较项插入左列

    <reference name="left">

 <block type="cms/block" name="block_left_top" ><action method="setBlockId"><block_id>block_left_top</block_id></action></block>

<block type="cms/block" name="block_left_social_icons" ><action method="setBlockId"><block_id>block_left_social_icons</block_id></action></block>

<action method="insert"><name>catalog.compare.sidebar</name></action>

</reference>

这对一个主要问题很有帮助。无论我做什么,比较侧边栏首先显示,而不是最后一个,这是我想要的。我尝试过使用before / after属性,但这些属性可以完全将块移到左侧列之外。

有没有人有任何见解?

谢谢!

1 个答案:

答案 0 :(得分:0)

无论

<block type="catalog/product_compare_sidebar" after="block_left_social_icons" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>

或者

<block type="catalog/product_compare_sidebar" after="-" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>

试过这样的事情?