Magento – Override Magento module layout “before/after”

layout

A third-party module inserts a block into the layout via before="-". Is there a way to insert a block before their block without editing the module's xml?

Best Answer

Simple, just use local.xml to override any layout - it's the last layout xml to be read.

source: http://magebase.com/magento-tutorials/digging-deeper-into-magentos-layout-xml-part-2/#layout-init (no. 7)

Be sure to assign the right handle for local.xml to "win". (this gave me trouble) http://magento-quickies.tumblr.com/post/6845142432/your-local-xml-layout-file-might-not-win

Another option would be (if creating a module) to "depend" your module on the other third-party module, thereby having it load afterwards and your xml will override (if any conflicts).

source: https://twitter.com/alanstorm/status/322399246135472128

Related Topic