Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Call static block with php in phtml file without defining it in xml
 
taavis
Jr. Member
 
Total Posts:  3
Joined:  2008-03-30
 

How do I call static block with php in phtml file without defining it in xml, becuse the static block has different name for each product?

 
Magento Community Magento Community
Magento Community
Magento Community
 
taavis
Jr. Member
 
Total Posts:  3
Joined:  2008-03-30
 

bumpadi bump bump

 
Magento Community Magento Community
Magento Community
Magento Community
 
Unirgy
Guru
 
Avatar
Total Posts:  478
Joined:  2007-09-07
 

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('your_block_id')->toHtml() ?>
 
Magento Community Magento Community
Magento Community
Magento Community
 
taavis
Jr. Member
 
Total Posts:  3
Joined:  2008-03-30
 

Thank You very much! It works now :D

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top