1

if I use a layout such as:

<layout>
   <{handle}>
       <reference name="content">
          ... {blocks} ...

According to docs and tutorial the reference's name attribute points to referencing an existing block so I'm just wondering where is the content block defined?

Help much appreciated.

2 Answers 2

4

For the regular frontend pages the content block is defined in the app/design/frontend/base/default/layout/page.xml:

<default translate="label" module="page">
    <label>All Pages</label>
    <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>
        </block>
    ...

for the adminhtml pages it is defined in the app/design/adminhtml/default/default/layout/main.xml

<default>
    <block type="adminhtml/page" name="root" output="toHtml" template="page.phtml">
    ...
        <block type="core/text_list" name="left" as="left"/>
        <block type="core/text_list" name="content" as="content"/>
        <block type="core/messages" name="messages" as="messages"/>
    ...

Note: For those who using enterprise theme package take a look at the app/design/frontend/enterprise/default/layout/page.xml file (in the enterprise package)

3
  • OK cool this is for frontend - what about backend? I'm on magento enterprise
    – gvanto
    Sep 11, 2017 at 10:53
  • @gvanto I've updated my answer. Sep 11, 2017 at 11:31
  • legendary thank you
    – gvanto
    Sep 11, 2017 at 12:42
1

<reference name="content"> Its a Structural block of type core/text_list, this structural block will automatically render all its children without the need to call the getChildHtml(), as like also <reference name="left">, <reference name="right">

This block is declared in xml as like this: <block type="core/text_list" name="content" as="content">

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.