Loading Magento child html outside of Magento
- by Christian Thamer
I am loading Magento blocks outside of Magento for certain parts of my site. I can do this successfully with something similar the following.
require_once $docRoot.'/app/Mage.php';
umask(0);
Mage::app('default');
...
$layout = Mage::getSingleton('core/layout');
$block = $layout->createBlock('Mage_Page_Block_Html_Header');
$block->setTemplate('page/html/header.phtml');
echo $block->renderView();
The problem is that if the block I am rending has child blocks(html) they are not included in the output. In the example above the file header.phtml contains the following call for child html that is missing from the output.
...
<?php echo $this->getChildHtml('topLinks') ?>
...