Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento: contents of <?php echo $this->getChildHtml('content') ?>

I've been playing around with magento's PHP files. However I cannot seem to figure out what gets pulled out with

<?php echo $this->getChildHtml('content') ?>

and from where this comes from. For instance, I can see a some text that says "Home Page" but I cannot find where this comes from by wading through the various files under /app/design/frontend/base/default and turning on template paths hints does not help.

The version of magento I am running is 1.7.0.2. Any help would be greatly appreciated.

like image 372
Jason Posit Avatar asked Oct 03 '22 21:10

Jason Posit


1 Answers

the content block is a structural block used to wrap all blocks for page content. getChildHtml('content') loads all blocks which are added in layout "content" either by

1. xml via <reference name="content"><block type="core/template') name="test" template="test.phtml"/>

2. code via $this->getLayout()->getBlock('content')->append($block);

the toHtml method of each block inside 'content' is called to return its html

like image 185
Michael Leiss Avatar answered Oct 11 '22 14:10

Michael Leiss