I am new to elFinder and have integrated it with ckeditor 4. I have not been able to figure out how to force elFinder to use relative path and not the full URL.
Right now when selecting an image: "https://localhost.com/UserFiles/image/flag-field.jpg"
I need it to be: "/UserFiles/image/flag-field.jpg"
Any assistance is greatly appreciated!
@loracalyn You can edit that URL in the function of getFileCallback.
I apologize, but I've tried to figure out how to do this, but can not. Can you give me more to go on.
I see getFileCallback in my elfinder-cke.html file. How do I accomplish a relative path
(Again, I appreciate any help you can give. I am new at this!)
managers : {
// 'DOM Element ID': { /* elFinder options of this DOM Element */ }
'elfinder': {
getFileCallback : function(file, fm) {
window.opener.CKEDITOR.tools.callFunction((function() {
var reParam = new RegExp('(?:[\?&]|&)CKEditorFuncNum=([^&]+)', 'i') ;
var match = window.location.search.match(reParam) ;
return (match && match.length > 1) ? match[1] : '' ;
})(), fm.convAbsUrl(file.url));
fm.destroy();
window.close();
}
, height : '100%' // optional
, resizable : false // optional
}
}
@loracalyn It is one example.
managers : {
// 'DOM Element ID': { /* elFinder options of this DOM Element */ }
'elfinder': {
getFileCallback : function(file, fm) {
var m = fm.convAbsUrl(file.url).match(/^https?:\/\/[^\/]+(.*)/);
window.opener.CKEDITOR.tools.callFunction((function() {
var reParam = new RegExp('(?:[\?&]|&)CKEditorFuncNum=([^&]+)', 'i') ;
var match = window.location.search.match(reParam) ;
return (match && match.length > 1) ? match[1] : '' ;
})(), m[1]);
fm.destroy();
window.close();
}
, height : '100%' // optional
, resizable : false // optional
}
}
nao-pon ... Thank you so much! I really appreciate your assistance!
Most helpful comment
@loracalyn It is one example.