在magento中如何调用static block?(ZT)

想在站点页面的某个地方放点静态的内容,比如广告,或者是促销信息之类的,这样的东西完全没有必要自己新建一个 block。完全可以使用cms的static block。创建完后,记住static block的id在模板中可以这样调用:

 

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('block_id')->toHtml() ?>
 
那如果要放在昨边什么办?
 
<reference name="left">
      <
block type="cms/block" name="left.permanent.callout">
          <
action method="setBlockId"><block_id>left_column_block</block_id></action>
      </
block>
</
reference>
 
在你要显示的那个页面对应的模块对应的layout handle中做上面修改,就可以放到左边栏位上去。想放在右边应该不难了吧。

转帖自CSDN blog xinhaozheng

评论

Magento is an open-source

Magento is an open-source ecommerce web application launched on March 31, 2008. It was created by Varien, building on components of the Zend Framework. Magento is available under the Open Software License version 3.0. Since version 1.1.7 some parts are licensed under the Academic Free License version 3.0. Magento Enterprise Edition, a paid for version of Magento aimed at larger companies, was launched on April 15, 2009. Varien, the company that owns Magento, formerly worked with osCommerce, touting themselves as the US leaders in osCommerce. They originally planned to fork osCommerce but later decided to rewrite it as Magento.

I am a student of ccnp practice exams and i am so much specialties in the network solution's.

:)现在日子不好过啊,打理时间少了,不好意思. 但是该坚持

:)现在日子不好过啊,打理时间少了,不好意思.

但是该坚持的事情总是要坚持,希望大家多多支持。谢谢了

呵呵,经常来支持呢。有空写个magento搬家的教程呗。

呵呵,经常来支持呢。有空写个magento搬家的教程呗。

写好了:)

写好了:)

一天更新这么多帖子,有点少见,呵呵,辛苦了

一天更新这么多帖子,有点少见,呵呵,辛苦了