Magento Template System

E-mail Print PDF

The template system in Magento is pretty controversial. The choice of using regular PHP for the templating language has caught some criticism froma fewusers. But, the choice of regular PHPhas notmade the templating system simple or under-powered, not by a long shot. This has to be the most flexible and advanced templating system that this author has ever seen (in PHP).

A complete page is rendered as a nested set of magento template files (technically, a nested set of Blocks). There are no explicit “widgets” in the system, that means, you won’t find a specific “Form” class nor “Button” class or object. The lowly Block classes straddle the line between widgets and templates. The nested set of templates and blocks is controlled by... you guessed it, an XML file, specifically a set of XML files. This is quite powerful for developers and plug-in contributors, but it seems that it is overly complicated for most designers (even those familiar with PHP et al.).

Layout Files The layout files control the structure of any final page rendering. They are located in the layout folder under your design theme. There are a number of XML files whose names loosely relate to an individual module, but they are all lower-case letters, whereas the module names traditionally use the so-called camel-case method. The most important XML file is page.xml.


The page.xml file specifies the default page structure. All modifications from any of the other XML files are modifications of settings under the default XML tag. The following is a list of tags that are common to all layout files.

Sometimes you will see tags like the following. These tags are layout handles, they behave like the default tag, but only during certain requests. These tags follow a pattern that relates to the module, controller, and action of the given Web request. If the tag only has two parts, separated by an underscore, like cms_page, then these settings are applied to all requests to that module and controller.


I have a little request for the petshop virtuemart template. Could you please help me change the home page image link?

--- Darrin

Ho intenzione di installare il ZenCart solo a causa di questo modello. Per favore mi dia le istruzioni.

--- Foscarini

Vaše Magento téma hodí i pro naše oblečení obchodě. Děkujeme vám.Laughing

--- Pospíšil

It's great experience to purchase a template here. They provide whole support about the template and any question is replied quickly.

--- Mcfarlane

is it possible to get a receipt or invoice for my purchased prestashop theme?

--- Micael

You are here: Magento Tutorial Magento Template System