Dynamic Block Call in CMS :
{{block type="banner/banner" template="banner/banner.phtml"}}
{{block type="contest/contest" template="contest/contest_home.phtml"}}
By placing the code for particular block as above, whole content return by that particular phtml file will be display in CMS page.
Static Block Call in CMS :
{{block type="cms/block" block_id="advertise-management"}}
As client wants to change regularly some part of home page, If we place that particular code in cms page only, then Client needs to find that particular portion of code in whole code. Rather than this, we can create static block for that particular portion of code & place that block as shown above.
Here block_id will be identifier , the field you have entered when creating static block. Identifier must be unique for every static block created.
Static Block Call in Template Files (.phtml files) :
getLayout()->createBlock('cms/block')->setBlockId('tshirtwearcontesttext')->toHtml() ?>
To call any static block to any template file , you need to write just above code & in setBlockId('blockIdentifier'), you need to pass the static block identifier, and your content will display in that particular page.
Subscribe to:
Post Comments (Atom)

0 comments:
Post a Comment