Prestashop:使用相对路径保存图像?
Prestashop: save images with relative path?
当我将图像上传到 CMS 页面 (Prestshop) 时,它是使用绝对路径保存的。如果您在本地主机上工作,然后将站点移动到远程服务器,这将非常糟糕。
我该如何更改?以便使用相对路径保存图像:
图片是这样保存的http://www.example.com/img/cms/my-image.jpg
我需要这样img/cms/my-image.jpg
你可以看看tinymce配置文件/js/admin/tinymce.inc.js
:
function tinySetup(config)
{
if(!config)
config = {};
//var editor_selector = 'rte';
if (typeof config.editor_selector != 'undefined')
config.selector = '.'+config.editor_selector;
default_config = {
selector: ".rte" ,
plugins : "colorpicker link image paste pagebreak table contextmenu filemanager table code media autoresize textcolor anchor",
browser_spellcheck : true,
toolbar1 : "code,|,bold,italic,underline,strikethrough,|,alignleft,aligncenter,alignright,alignfull,formatselect,|,blockquote,colorpicker,pasteword,|,bullist,numlist,|,outdent,indent,|,link,unlink,|,anchor,|,media,image",
toolbar2: "",
external_filemanager_path: ad+"/filemanager/",
filemanager_title: "File manager" ,
external_plugins: { "filemanager" : ad+"/filemanager/plugin.min.js"},
language: iso,
skin: "prestashop",
statusbar: false,
relative_urls : false,
convert_urls: false,
entity_encoding: "raw",
extended_valid_elements : "em[class|name|id]",
valid_children : "+*[*]",
valid_elements:"*[*]",
menu: {
edit: {title: 'Edit', items: 'undo redo | cut copy paste | selectall'},
insert: {title: 'Insert', items: 'media image link | pagebreak'},
view: {title: 'View', items: 'visualaid'},
format: {title: 'Format', items: 'bold italic underline strikethrough superscript subscript | formats | removeformat'},
table: {title: 'Table', items: 'inserttable tableprops deletetable | cell row column'},
tools: {title: 'Tools', items: 'code'}
}
};
$.each(default_config, function(index, el)
{
if (config[index] === undefined )
config[index] = el;
});
tinyMCE.init(config);
}
有一个名为 relative_urls
的值默认设置为 false
。
当我将图像上传到 CMS 页面 (Prestshop) 时,它是使用绝对路径保存的。如果您在本地主机上工作,然后将站点移动到远程服务器,这将非常糟糕。
我该如何更改?以便使用相对路径保存图像:
图片是这样保存的http://www.example.com/img/cms/my-image.jpg
我需要这样img/cms/my-image.jpg
你可以看看tinymce配置文件/js/admin/tinymce.inc.js
:
function tinySetup(config)
{
if(!config)
config = {};
//var editor_selector = 'rte';
if (typeof config.editor_selector != 'undefined')
config.selector = '.'+config.editor_selector;
default_config = {
selector: ".rte" ,
plugins : "colorpicker link image paste pagebreak table contextmenu filemanager table code media autoresize textcolor anchor",
browser_spellcheck : true,
toolbar1 : "code,|,bold,italic,underline,strikethrough,|,alignleft,aligncenter,alignright,alignfull,formatselect,|,blockquote,colorpicker,pasteword,|,bullist,numlist,|,outdent,indent,|,link,unlink,|,anchor,|,media,image",
toolbar2: "",
external_filemanager_path: ad+"/filemanager/",
filemanager_title: "File manager" ,
external_plugins: { "filemanager" : ad+"/filemanager/plugin.min.js"},
language: iso,
skin: "prestashop",
statusbar: false,
relative_urls : false,
convert_urls: false,
entity_encoding: "raw",
extended_valid_elements : "em[class|name|id]",
valid_children : "+*[*]",
valid_elements:"*[*]",
menu: {
edit: {title: 'Edit', items: 'undo redo | cut copy paste | selectall'},
insert: {title: 'Insert', items: 'media image link | pagebreak'},
view: {title: 'View', items: 'visualaid'},
format: {title: 'Format', items: 'bold italic underline strikethrough superscript subscript | formats | removeformat'},
table: {title: 'Table', items: 'inserttable tableprops deletetable | cell row column'},
tools: {title: 'Tools', items: 'code'}
}
};
$.each(default_config, function(index, el)
{
if (config[index] === undefined )
config[index] = el;
});
tinyMCE.init(config);
}
有一个名为 relative_urls
的值默认设置为 false
。