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') ?>
精彩评论