0

Can someone tell me the path to edit the content in

<?php echo $this->getChildHtml('content') ?>
  • which content your are going to edit??if it is CMS pages content you can do it from admin side only please be more specific. – dh47 Nov 19 '14 at 4:08
  • its for the home page my home page is taking time to load so I was thinking to comment echo $this->getChildHtml('breadcrumbs') echo $this->getChildHtml('global_messages') echo $this->getChildHtml('before_footer') echo $this->getChildHtml('before_body_end') – nikhil carvalho Nov 19 '14 at 5:37
3

getChildHtml() method is a special function which will used to show html content of a child block inside a parent block. The method is defined inside the class Mage_Core_Block_Abstract which is located at app/code/core/Mage/Core/Block/Abstract.php.

Basically we can pass three parameters to this method. In which first one is important. The first parameter is name of a child block. In this case content is a child block name.

content block is core/text_list type block. This block is actually used to hold all other blocks that should come inside the content section of a page. There are other similar block does exist in Magento. Some of them are left, right blocks etc. As their name indicates they holds blocks which will come under in specific place of a page. Hence we can call this blocks as structural blocks since they actually responsible for making structure of a page.

There is only one parent block that holds these structural blocks. It is root block. Root block is also can be treat as a page layout container block which just act as a container block of magento page layout.

All of this definitions comes inside page.xml file.

However in general it is very difficult find which block stands for

 getChildHtml('some.name');

In order to find some.name block, first we need to find the template that holds this method stands for which block. Then you should find which layout xml file defines that parent block. Then you can see a child block with name some.name inside that block there. However it is not 100% sure. The inclusion of a child block can happen anywhere.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.