Faced with the problem of adding an image items in Magento 1.4.0.1 and finally found a solution to this problem.
To address this problem, the trick for the moment is in the file wysiwyg at the core.
in app/code/core/Mage/Cms/Helper/Wysiwyg/Images.php
Replace the line 136 around getImageHtmlDeclaration function with the following:
{code type=css}
public function getImageHtmlDeclaration($filename, $asIs = false)
{
$fileurl = $this->getCurrentUrl() . $filename;
$mediaPath = str_replace(Mage::getBaseUrl(’media’), ”, $fileurl);
$directive = sprintf(’{{media url=”%s”}}’, $mediaPath);
$directive = $fileurl;
if ($asIs) {
$html = sprintf(’‘, $directive);
} else {
$html = $directive;
// $directive = Mage::helper(’core’)->urlEncode($directive);
// $html = Mage::helper(’adminhtml’)->getUrl(’*/cms_wysiwyg/directive’, array(’___directive’ => $directive));
}
return $html;
}
{/code}
And that’s it, although it may be problematic to directly modify a file in the core.
This entry was posted on Saturday, July 3rd, 2010 at 4:40 am and is filed under Magento Admin, Magento Templates. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.












December 2nd, 2010 at 10:15 pm
…Really inspiring write-up, Thank you !!…
December 5th, 2010 at 2:44 pm
…Hello there, I should say it really is a clever posting. I’ll definitely be searching in on this web site yet again quickly….
December 16th, 2010 at 9:09 pm
…Thanks! it is helpful to me!…
August 15th, 2011 at 5:17 pm
Simply wish to say your article is as astounding. The clearness on your put up is simply spectacular and i can think you’re knowledgeable on this subject.September 1st, 2011 at 12:14 am
I have been browsing online more than 3 hours nowadays, but I by no means found any interesting article like yours. It is lovely value sufficient for me. In my view, if all webmasters and bloggers made good content as you probably did, the internet can be much more helpful than ever before.