Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relative or Absolute URL passed to CKEditor? #436

Open
justingit opened this issue Jan 7, 2016 · 5 comments
Open

Relative or Absolute URL passed to CKEditor? #436

justingit opened this issue Jan 7, 2016 · 5 comments

Comments

@justingit
Copy link

I'm having trouble figuring this out - is a relative or absolute URL passed to something like CKEditor when you hook up Filemanager to CKeditor via CKeditor's config.filebrowserImageBrowseUrl (and friends)

I'm noticing it's site root–relative, so if my site is at http://example.com and I'm uploading files into

http://example.com/file_uploads/

CKeditor is receiving:

/file_uploads/my_image.jpg

Is that the correct behavior? I could have sworn in previous versions of Filemanager it would give back an absolute URL. Is there a way to change this behavior? I couldn't find anything that looked like what I was looking for in the docs.

@simogeo
Copy link
Owner

simogeo commented Jan 7, 2016

You can provide both relative or absolute urls. It will work as expected :

CKEDITOR.replace('editor1', {
 filebrowserBrowseUrl: './',
    filebrowserUploadUrl : './connectors/php/filemanager.php?mode=upload',
    filebrowserImageBrowseUrl : './',
    filebrowserImageUploadUrl : './connectors/php/filemanager.php?mode=upload&type=images',
    filebrowserWindowWidth  : 800,
    filebrowserWindowHeight : 500
});
CKEDITOR.replace('editor1', {
    filebrowserBrowseUrl: 'http://localhost/Filemanager/',
    filebrowserUploadUrl : 'http://localhost/Filemanager/connectors/php/filemanager.php?mode=upload',
    filebrowserImageBrowseUrl : 'http://localhost/Filemanager/',
    filebrowserImageUploadUrl : 'http://localhost/Filemanager/connectors/php/filemanager.php?mode=upload&type=images',
    filebrowserWindowWidth  : 800,
    filebrowserWindowHeight : 500
});

@justingit
Copy link
Author

What I'm asking is, does Filemanager return an absolute or relative URL back to something like CKEditor?

@simogeo
Copy link
Owner

simogeo commented Jan 7, 2016

the FM returns a relative path, but this can be changed by specifying baseUrl in config file.

@justingit
Copy link
Author

Thanks. baseUrl is set to "false" by default, but you would want to set it to a absolute URL, if you want to utilize it (instead of say, "true")

@simogeo
Copy link
Owner

simogeo commented Jan 15, 2016

setting it totrue would probably just bug. The FM is expecting for an url or false value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants