page.xml 定义:
----------------------------
<block type="core/text_list" name="right" as="right" translate="label">
<label>Right Column</label> </block>=============================================
在catalog.xml里用reference 来扩展定义:
首页右边栏:
-------------------------------------
<default>
<reference name="right"> <block type="catalog/product_compare_sidebar" before="cart_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
<block type="core/template" name="right.permanent.callout" template="callouts/right_col.phtml"> <action method="setImgSrc"><src>p_w_picpaths/media/col_right_callout.jpg</src></action> <action method="setImgAlt" translate="alt" module="catalog"><alt>Keep your eyes open for our special Back to School items and save A LOT!</alt></action> </block> </reference></default>
============================================
具体商品详细页:
-------------------------------------
<!--
Product view --><catalog_product_view translate="label"> <label>Catalog Product View (Any)</label>
<reference name="right"> <block type="catalog/product_list_related" name="catalog.product.related" before="-" template="catalog/product/list/related.phtml"/>
</reference> </catalog_product_view>==========================================
用before,after 选择器来决定区块的位置,before="-"表示位于最前面。