enter image description hereMy XML code is here

<?xml version="1.0"?>
<layout version="0.1.0">
    <reference name="product.info">
        <block type="demo/demo" before="product.description" name="demo" template="demo/demo.phtml" />

i want to put my block under product.info and above product.description

i dont to change any core file and dont want to use getChildHtml method

3 Answers 3


try this:

        <reference name="alert.urls"> 
            <block type="total/prototal"  name="total_prototal" template="total.phtml" />  

make sure this line must be exist in view.phtml file:

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

Hope this helps!


Go to the view file of your theme and add this at where you are willing to display the content..


You can control the order of your inserted blocks by the node's attribute before and after. See http://www.magentocommerce.com/knowledge-base/entry/controlling-block-order to get more info.

But, as you are setting your demo.demo block as a child of product.info it will not be rendered as child block, as long as you are not rendering it by getChildHtml inside catalog/product/view.phtml (product.info's template file).

Set your block not inside product.info but outside, right before it by the descripted technique mentioned above:

    <block type="demo/demo" before="product.info" name="demo" template="demo/demo.phtml" />

Child blocks are not automatically rendered by iterating through its children. There are just a few block types where this is true. See http://blog.philwinkle.com/the-most-misunderstood-concept-in-magento/ to get an understanding about this and the misconception of blocks in Magento.

Auto-rendered blocks

When defined in a layout, any block of type core/text_list will automatically render all its children. While core/text will automatically render itself it really only should contain text and therefore is not useful for layout purpose


Other blocks

Any other block type will need to be rendered manually. Provide the block an alias which can then be passed to getChildHtml, returning the content which you then echo.

to give you a tl;dr.

  • My xml is <?xml version="1.0"?> <layout version="0.1.0"> <default> </default> <catalog_product_view> <reference name="content"> <block type="demo/demo" name="demo" template="demo/demo.phtml" /> </reference> </catalog_product_view> </layout> i am trying to develop my extension and i want put this block under product.info is there any other way to put this block in product.info with out changing core files Commented Dec 25, 2014 at 7:41
  • Use after="product.info" as attribute of your XML node if you want your output be rendered after product.info. Please understand that you can't change the order of the product.info children without editing template files or using dirty tricks.
    – Nicolas
    Commented Dec 25, 2014 at 7:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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