Skip to main content

Denotes the xml files used to define the block hierarchy which eventually renders the template files.

The layout includes the XML files used to render the template files. Both adminhtml and frontend use the layout files. Layout files are usually used to relate the block and template files so that the template files can access the related functions from their block files.

All module layout files are merged before the layout is processed. Which declarations are used, is determined with layout handles. There are layout handles for each route, for different product types, for "logged in" and "logged out" and others.

The layout handles then define a hierarchy of blocks that are rendered with their toHtml() method, usually with a phtml template.

There are two possible ways to customize the page layout in Magento:

  • Changing layout files.
  • Altering templates.

To change the page wireframe, modify the page layout files; all other customizations are performed in the page configuration or generic layout files.