Reputation: 33
I have downloaded a custom module in magento that loads a block into layout using a reference:
<reference name="content">
<block type="ibanner/content_top" name="ibanner_content_top" template="my_ibanner/content/top.phtml" before="-"/>
<block type="ibanner/content_bottom" name="ibanner_content_bottom" template="my_ibanner/content/bottom.phtml" after="-"/>
</reference>
This code is working fine. However if i use the header refence the banner is not displayed on the page i can't figure out why...
If i use the page_two_columns_left layout and reference the left name layout block, the banner shows up, i can't tell the diference between the blocks to make some of them load the baner and others wont.
If somewone can help me out with this i will really apreciate it.
Regards.
Upvotes: 2
Views: 4130
Reputation: 23205
Part of "injecting" a block in different routes depends on the parent block. "content" and "left" are core/text_list
blocks (Mage_Core_Block_Text_List
), which by design do not use templates and simply render all child blocks. If a block uses a template however, you must (should) take two steps:
<?php echo $this->getChildHtml("ibanner_content_top") ?>
.Note that template files which contain an empty getChildHtml()
call will render all child blocks.
Upvotes: 1