Hi, I have problem with integrating Elfinder with TinyMCE4. Everything is fine, when i click on insert image in TinyMCE, Elfinder opens, then i choose image, but elfinder returns object object or relative path... I tried both methods posted on wiki, but with no result. When i use the first integration method, elfidner returns object object, and with second method elfinder returns relative path. Any ideas how to fix this problem?
@Vartex05 In first method in Wiki example, change
From
FileBrowserDialogue.mySubmit(file);
To
FileBrowserDialogue.mySubmit(file.url);
will be solved.
And If you need absolute URL. Please set absolute URL to volume roots option URL.
I did that but it still returns adresses like ../../../assets/js/elfinder/files/images.png, so when i save it and display the content of tinymce area on another site, the images wont load
Could you show me your connector configuration?
$opts = array(
// 'debug' => true,
'roots' => array(
array(
'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED)
'path' => '../files/', // path to files (REQUIRED)
'URL' => 'http://localhost/tabule/assets/js/elfinder/files/', // URL to files (REQUIRED)
'uploadDeny' => array('all'), // All Mimetypes not allowed to upload
'uploadAllow' => array('image', 'text/plain'),// Mimetype image and text/plain allowed to upload
'uploadOrder' => array('deny', 'allow'), // allowed Mimetype image and text/plain only
'accessControl' => 'access' // disable and hide dot starting files (OPTIONAL)
)
)
);
weird think is, that if u choose insert video in tinymce, elfinder returns correct adress. But in case of image it returns relative adress...
It's odd. Probably, volume driver returning relative URL in the url of the item data. Are you extend something volume driver? e.g. bind action...
As one of the solution there is a way to convert the relative URL to an absolute URL.
getFileCallback: function(file, fm) { // editor callback
file.url = fm.convAbsUrl(file.url);
// do something...
}
I tried that solution but even after i convert url it returns relative path :/ Its really very odd
Ok i solved the problem, TinyMCE in default convertns any urls to relative... It must be tun off in settings... Anyway thx for help and your time...
OK, i got it. Congratulation!
Most helpful comment
Ok i solved the problem, TinyMCE in default convertns any urls to relative... It must be tun off in settings... Anyway thx for help and your time...