XML tags 介绍：
Each Magento module has it is own layout file, for instance ”catalog.xml” is a layout file for the catalog module”
and “customer.xml” is for the customer module. 每个模块都有一个布局的xml文件。
Each file is further separated into handles. xml文件具体由handles组成。
The handles that are available are pre-defined in the Magento core and by any active extensions in your store.
For the most part, each handle corresponds to a type of page within your Magento store,
such as <catalog_category_default> and <catalog_product_view>,
but there are some handles that apply to all pages, such as the <default> handle,
and some that apply within pages based on specific statuses, such as <customer_logged_in> and <customer_logged_out>.
A handle can occur in multiple layout files and blocks can be assigned to that handle or overridden by each layout file. For example, most layout files may contain the <default> handle. When parsing the layout files, Magento first grabs the layout updates assigned in the <default> handle in each of the layout files, reading them in the order as assigned in app/etc/modules/Mage_All.xml. It then parses the page-specific layout handles, again looking in all of the layout files for that handle, and finalizes the building of a store page.
Magento determines the behavior and visual representation of each building block of a page via the <block> tag. We have already mentioned the two types of blocks Magento employs - structural blocks and content blocks. The best way to distinguish between the two is by examining the behavior assigned to each via the tag attributes. A structural block usually contains the attribute ”as,” through which the application is able to communicate with the designated area (using the getChildHtml method) in a template. You will notice many occurrences of this ”as” attribute in the default layout, because by nature the default layout is one that builds the groundwork upon which the page-specific layouts can begin adding onto. For instance, in the default layout, there are structural blocks such as ”left,” ”right,” ”content” and ”footer” being introduced. Although these blocks can exist in normal layout updates, why not first set up the reoccurring structural blocks in the default layout first, and then start adding content on a per-page basisThe available attributes for <block> are:
• type – This is the identifier of the module class that defines the functionality of the block. This attribute must not be modified.
• name – This is the name by which other blocks can make reference to the block in which this attribute is assigned
• before (and) after – These are two ways to position a content block within a structural block. before=“-” and after=“-” are commands used to position the block accordingly at the very top or very bottom of a structural block.
• template - This attribute determines the template that will represent the functionality of the block in which this attribute is assigned. For instance, if this attributes is assigned ‘catalog/category/view.phtml’, the application will load the ‘app/design/frontend/template/catalog/category/view.phtml template file.
• as – This is the name by which a template calls the block in which this attribute is assigned. When you see the getChildHtml(‘block_name’) PHP method called from a template, it is referring to the block whose attribute ”as” is assigned the name ‘block_name’. (i.e. The method <?=$this->getChildHtml(‘header’)?> in the a skeleton template correlates to <block as=“header”> ). - as 表示分配给某个区块，可以用getChildHtml来调用。
<reference> is used to make reference to another block. By making a reference to another block, the updates inside <reference> will apply to the <block> to which it correlates (如下图).
To make the reference, you must target the reference to a block by using the ”name” attribute. This attribute targets the <block> tag’s ”name” attribute. Therefore, if you were to make a reference by <reference name=“right”>, you are targeting the block named <block name=“right“>.