把magento所见即所得默认生成的图片缓存路径改为图片真实路径
2016-09-14 09:52
507 查看
From:
/admin/cms_wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5c2l3eWcvd2lkZ2V0cy9iYW5uZXIvaG9tZXBhZ2UvZm9yZWdyb3VuZC9maXNoLXRhbmsucG5nIn19/key/e8167e3884e40b97d8985e7b84e7cbc7875f134e5f7e5946c9c2a482d0279762/
To:
/media/wysiwyg/path/to/file/photo.jpg
1、 Adding a new GET parameter
2、Override the
3、Handle the new parameter in the
4、Override the
/admin/cms_wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5c2l3eWcvd2lkZ2V0cy9iYW5uZXIvaG9tZXBhZ2UvZm9yZWdyb3VuZC9maXNoLXRhbmsucG5nIn19/key/e8167e3884e40b97d8985e7b84e7cbc7875f134e5f7e5946c9c2a482d0279762/
To:
/media/wysiwyg/path/to/file/photo.jpg
1、 Adding a new GET parameter
use_file_urlto the URL
$url = $this->getUrl( '*/cms_wysiwyg_images/index', array( 'target_element_id' => $element->getName(), 'use_file_url' => 1 ) );
2、Override the
getOnInsertUrl()function of the
Mage_Adminhtml_Block_Cms_Wysiwyg_Images_Content:
public function getOnInsertUrl() { $useFileUrl = (int)$this->getRequest()->getParam('use_file_url', 0); return $this->getUrl('*/*/onInsert', array('use_file_url' => $useFileUrl)); }
3、Handle the new parameter in the
Mage_Adminhtml_Cms_Wysiwyg_ImagesControllercontroller:
public function onInsertAction() { $useFileUrl = (int)$this->getRequest()->getParam('use_file_url', 0) == 1 ? true : false; $helper = Mage::helper('cms/wysiwyg_images'); $storeId = $this->getRequest()->getParam('store'); $filename = $this->getRequest()->getParam('filename'); $filename = $helper->idDecode($filename); $asIs = $this->getRequest()->getParam('as_is'); Mage::helper('catalog')->setStoreId($storeId); $helper->setStoreId($storeId); if ($useFileUrl == false) { $image = $helper->getImageHtmlDeclaration($filename, $asIs); } else { $image = $helper->getImageMediaUrl($filename); } $this->getResponse()->setBody($image); }
4、Override the
Mage_Cms_Helper_Wysiwyg_Imageshelper and add the
getImageMediaUrl()function:
public function getImageMediaUrl($filename) { return $this->getCurrentUrl() . $filename; }
相关文章推荐
- jfree.chart生成图片默认路径问题。
- android 使用Glide加载图片的默认缓存路径
- 获取图片路径--生成缩略图的完整实现
- 让可执行文件进入linux系统默认路径,主题桌面图片等等。
- 解决IE6下默认不缓存背景图片的bug
- php magento关于图片路径引用问题
- 让Magento生成的PDF打印图片(Magento invoice shipment pdf add product images)
- asp下如何隐藏图片文件的真实路径
- Wordpress最新3.5版本如何修改图片默认上传目录路径
- E6下默认不缓存背景图片
- linux下修改avd默认生成路径
- 修改jfreechart默认生成图形的保存路径
- 获取图片路径--生成缩略图的完整实现
- Tha path in Magento: Magento 默认路径变量
- IE6默认不缓存背景图片,引起鼠标抖动的解决方法
- IE6默认不缓存背景图片,引起鼠标抖动的解决方法
- xp/2000的浏览器默认缓存文件夹路径(如下)
- c#隐藏图片真实名称及路径
- 处理IE6下默认不缓存背景图片的问题
- 【浏览器兼容性】 IE6下背景图片默认不缓存,导致hover效果闪烁的解决办法