Skip to content

Relative or Absolute URL passed to CKEditor?  #436

Open

Description

@justingit

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.

Activity

  1. simogeo commented on Jan 7, 2016

    @simogeo
    Owner

    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
    });
    
  2. justingit commented on Jan 7, 2016

    @justingit
    Author

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

  3. simogeo commented on Jan 7, 2016

    @simogeo
    Owner

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

  4. justingit commented on Jan 14, 2016

    @justingit
    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")

  5. simogeo commented on Jan 15, 2016

    @simogeo
    Owner

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions