magento中Static Block创建及引用
1、直接在代码中调用Static Block
<?php
echo $this->getLayout()->createBlock('cms/block')->setBlockId('block_identifier')->toHtml()
?>
2、在Static Block或Pages中嵌入Static Block
{{block type="cms/block" block_id="block_identifier"}}
3、Static Block或Pages中嵌入Template
{{block type="core/template" template="path-to-template.phtml"}}
4、Tempate中嵌套Template
<?php
$this->getLayout()->createBlock('Mage_Adminhtml_Block_Template', 'block-name')->setData('template', 'path-to-your-file.phtml')->toHtml();
?>
5、修改xml增加Static Block引用
<block type="cms/block" name="cms_foo_share" as="foo_share">
<action method="setBlockId"><block_id>foo_share</block_id>
</action>
</block>
在页面中通过getChildItem获取