Before And After In Local.xml Magento?

喜夏-厌秋 提交于 2019-12-04 07:12:50

before: Used to position the block before a block with the name specified in the value. If "-" value used the block is positioned before all other blocks of its level of block nesting.

after: Used to position the block after a block with the name specified in the value. If "-" value used the block is positioned after all other blocks of its level of block nesting.

Updated: examples from some random core layout updates:

<reference name="right">
    <block type="catalog/product_compare_sidebar" before="cart_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
</reference>

<reference name="right">
    <block type="catalog/product_list_related" name="catalog.product.related" before="-" template="catalog/product/list/related.phtml"/>
</reference>

Updated: I believe before and after work only in core/text_list and similar(descendant) blocks, i.e. blocks which just render blocks their nested blocks.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!