开发者

more ways to add a static block in a page, but what is the best way?

i would like to know what is the best way to insert the created static block in to my page. f.i. the second block in the left column of bokszakkenstore.nl i inserted that block by adding it in catalog.xml but now i also see that you can add it by editing the left-col.phtml or page.xml or page.phtml.

so what is the best way and why?

开发者_JS百科here's how i did it in catalog.xml with my static block left_banner

left_banner

thanks in advance


The quickest way is like this:

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('block_identifier')->toHtml(); ?> 

But you can also create it as an XML block in your layouts folder and bring it out in the usual way (I prefer this when using custom themes):

<?php echo $this->getChildHtml('block_identifier') ?> 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜