Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento Load static block into php file

Tags:

php

magento

I have created a custom form that loads on an iframe. It also has the send.php form which is a custom file also. I need as a thank you message though to load the content from a static block so client can change it.

How can I load the text from the static block into a custom php file?

Thank you

like image 952
user2607179 Avatar asked Nov 30 '22 12:11

user2607179


1 Answers

Try this:

require_once 'path/to/'.'Mage.php'; //replace 'path/to' with the relative path to your Mage.app file
echo Mage::app()->getLayout()->createBlock('cms/block')->setBlockId('some_block_id')->toHtml();
like image 197
Marius Avatar answered Dec 05 '22 23:12

Marius