1. 对于 type="core/text_list"的block
<reference name="after_body_start">
<block type="core/template" name="containerForGoogleCode" template="sky/container.phtml" ></block></reference>
将 template="sky/container.phtml" 模板插入 after_body_start block 中
注意:上面 block 标签中的 name 属性 不能等于 reference 的name 属性 ,否则 前者将替换后者,即 template="sky/container.phtml" 模板
将会替换原始的 name="after_body_start" 的 block 所定义的模板。
2. 对于 type !="core/text_list" 的block,可以在其模板中,
<?php echo $this->getChildHtml("containerForGoogleCode") ?>
<reference name="root">
<block type="core/template" name="containerForGoogleCode" template="sky/container.phtml" ></block></reference>
或者直接
<reference name="root">
<block type="core/template" name="containerForGoogleCode" template="sky/container.phtml" output="toHtml"></block></reference>