Magento XML $this->getChildHtml() necessary? -
i have edited following file, move newsletter footer instead of sidebar
app/design/frontend/base/default/layout/newsletter.xml i changed following code:
<reference name="left"> <block type="newsletter/subscribe" name="left.newsletter" template="newsletter/subscribe.phtml"/> </reference> to:
<reference name="footer"> why did not need add
$this->getchildhtml('newsletter') or similar footer.phtml? unsure when use getchildhtml() , when not to. steps necessary in exercise#2 of this article ?
thanks.
if take @ page/html/footer.phtml, footer block's template
<div class="footer-container"> <div class="footer"> <?php echo $this->getchildhtml() ?> <p class="bugs"><?php echo $this->__('help keep magento healthy') ?> - <a href="http://www.magentocommerce.com/bug-tracking" onclick="this.target='_blank'"><strong><?php echo $this->__('report bugs') ?></strong></a> <?php echo $this->__('(ver. %s)', mage::getversion()) ?></p> <address><?php echo $this->getcopyright() ?></address> </div> </div> you can see they've used following php output child blocks
<?php echo $this->getchildhtml() ?> when getchildhtml called without parameter, output any block that's been added. that's why didn't need include own call $this->getchildhtml('newsletter')
Comments
Post a Comment