Magento XML using before/after to place blocks hardly ever works

前端 未结 2 445

I\'m a front-end Magento dev, have built quite a few of my own themes and I want to understand Magento\'s XML block positioning better...

I normally use a loca

2条回答
  •  独厮守ぢ
    2020-12-04 12:51

    I wonder but it seems that Mage_Core_Block_Abstract:

    public function getChildHtml($name = '', $useCache = true, $sorted = false)
    

    doesn't render the blocks in order because of $sorted = false.

    So finally the order/sorting of blocks is by default only considered in Core/Block/Text/List - Block.

    If you want to ensure that child blocks were output in correct order you have to use:

    getChildHtml('', true, true) ?>
    

提交回复
热议问题