I'm new to Magento, and am wondering what the reference tag is for in the [mylayout].xml file.

<reference name="root">
    <block type="dennis/mijnblok" name="content" output="toHtml" template="oefening/all/Mijnblok.phtml" />

If I change reference name to content it will not work.

But, when I change name="content" to name="test", it does work.

So I'm wondering why, can anyone explain?

3 Answers 3


reference meaning you are going to using the already defined block.

By default all pages has following block

1.Header 2.Content 3.Left 4.Right 5.Footer

If you want to inculde some thing in the content block you use as content block as reference

   <reference name="content">
     <!-- your block code -->
           <block type="dennis/mijnblok" name="block.unique.name" template="oefening/all/Mijnblok.phtml" />


Note : Block name must be unique

Refer this Tutorial you will get better understanding of the layout in magento

  • Thanks, but why is the root name always working, and the content name not?
    – Refilon
    Commented Nov 16, 2015 at 13:34

I think this will be because "content" is actually the main content area in which you should be putting your Mijnblok.html


<default translate="label" module="page">
    <block type="page/html" name="root" output="toHtml" template="page/3columns.phtml">
        <block type="core/text_list" name="content" as="content" translate="label">
            <label>Main Content Area</label>

Reference element is used to link an already defined block in any layout XML. To add any child block to an existing block, to modify attributes of an existing block or to perform any action on an existing block, the reference element is used to link to the existing block. The reference element must have a name attribute which refers to the existing block’s name.

and etc

These are predefined block in magento. you cannot use that name as a block name. if you use that then there is name conflict and your block will not shown.

  • Can't find root as a block?
    – Refilon
    Commented Nov 16, 2015 at 13:34

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.