没有回复
涉水轻舟
涉水轻舟 头像
Offline
Joined: 01-20
Magento 里添加页面子静态区块(Static block)的方法

Call Sub Static blocks direct from phtml pages (eg. add a Staitic block to Newsletter phtml ).

1. Create a cms block in backoffice, and specify the block id, in this case is "newsletter_text".
2. Define block in newsletter.xml, not in cms.xml or page.xml.

代码: 
   <default>
   <reference name="right.newsletter">
      <block type="cms/block" name="newletter_blocks" as="newletter_blocks" after="-">
         <action method="setBlockId"><block_id>newsletter_text</block_id></action>
      </block>
   </reference>
   </default>


3. Call block on whereever of subscribe.phtml page

代码: 
   <?php echo $this->getChildHtml('newletter_blocks') ?>

为了使自己对生活发生兴趣,我一直在努力……