I created a block under CMS -> Static Blocks with the following content:

<a href="http://www.foo.com">
   <img src="{{media url="wysiwyg/email/751-footer.png"}}"/>

Unfortunately the media directive interprets to src="{{media url=" when I try to load the CMS Block via

$signaturemodel = Mage::getModel('cms/block')->load('email_signature');

$signature = $signaturemodel->hasData() ? $signaturemodel->getContent() : "";
echo $signature;

Is there any chance to get the correct media url?


1 Answer 1


There are different solutions depending on the context.


// use thestatic block email_signature
$signature = '';
$block = Mage::getModel('cms/block')

if ($block->getIsActive()) {
    /* @var $helper Mage_Cms_Helper_Data */
    $helper    = Mage::helper('cms');
    $processor = $helper->getBlockTemplateProcessor();
    $signature = $processor->filter($block->getContent());

echo $signature;

or in a .phtml-File

echo $this->getLayout()->createBlock('cms/block')

For better understanding have a look at app/code/core/Mage/Cms/Block/Block.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.