CMS 页面不在管理面板中显示图像
我对 magento cms 模块有一个奇怪的问题。
前端的所有 CMS 页面均正确显示图像,但管理 cms 编辑器页面上未显示图像。它只显示“X”图像损坏图标。
我实际上不知道从哪里开始解决这个问题。
有人有类似的问题吗?
I have a weird problem with magento cms module.
All the CMS pages on the frontend are displaying images correctly, but images are not displaying on the admin cms editor page. It just displays 'X' image broken icon.
I actually don't know where to start to fix this issue.
Any one had similar issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果在前端您有文件 http://yourdomain.com/media/your_file.jpg在后端编辑内容时,该文件通过 smtg 链接,如 http://yourdomain.com/index.php/admin/cms_wysiwyg/directive/key/b9f80b36bc860a90ea2a03b61a6babfa/___directive/e3ttZWRpYSB1cmw9InBvd2RlcnNfOTB4OTAuanBnIn19/ 和这个图像已损坏。
问题是在Mage_Adminhtml_Cms_WysiwygController (Mage/Adminhtml/controllers/Cms/WysiwygController.php) 方法directiveAction 中,$url 是...一个url(当然)而不是图像路径,这正是我们在本例中需要的。
您可以创建一个覆盖directiveAction的模块,并且您需要将$url分配替换为
$url = BP . str_replace(Mage::app()->getStore()->getConfig('web/unsecure/base_url'),"/", Mage::getModel('core/email_template_filter')->filter($directive ) );
希望对你有用,
基。
If in frontend you have the file http://yourdomain.com/media/your_file.jpg which renders perfectly, when editing the content in backend that file is linked through smtg like http://yourdomain.com/index.php/admin/cms_wysiwyg/directive/key/b9f80b36bc860a90ea2a03b61a6babfa/___directive/e3ttZWRpYSB1cmw9InBvd2RlcnNfOTB4OTAuanBnIn19/ and this image is broken.
The problem is that in Mage_Adminhtml_Cms_WysiwygController (Mage/Adminhtml/controllers/Cms/WysiwygController.php) method directiveAction the $url is ... an url (of course) instead of an image path which is what we need in this case.
You can create a module that overwrites the directiveAction and you would need to replace the $url assignment to
$url = BP . str_replace(Mage::app()->getStore()->getConfig('web/unsecure/base_url'),"/", Mage::getModel('core/email_template_filter')->filter($directive) );
hope that works for you,
Ky.
尝试在管理员中更改以下内容:
System ->配置->一般->内容管理->将目录中所见即所得的媒体内容使用静态 URL
更改为是
此设置至少存在于 1.7.0.2 中。
Try changing the following in your admin :
System -> Configuration -> General -> Content Management -> Use Static URLs for Media Content in WYSIWYG for Catalog
toYes
This setting is present in 1.7.0.2 at least.