|
The layout kicks out an entire page because the “root” tag in the layout/page.xml is set to be an “output” block. So, all you have to do is switch which block you want to be the main block as the only “output” block and the layout will start there and go down to any child blocks as normal.
$this->getLayout->removeOutputBlock('root'); $this->getLayout()->addOutputBlock('my_sub_block');
Makes sense? Too bad it doesn’t work. You’ll have to add the method “removeOutputBlock” yourself. It should be in the next release after 0.8 as a standard method.
// in Mage/Core/Model/Layout.php
/** * Remove a block from output * * @param string $blockName */ public function removeOutputBlock($blockName) { unset($this->_output[$blockName]); }
I really wish people wouldn’t use private/protect/public with out a WHOLE LOT of thought put into the API first.
|