@extends('ckfinder::samples/layout') @section('content')
To integrate CKFinder with CKEditor all you have to do is pass some additional configuration options to CKEditor:
CKEDITOR.replace( 'editor1', {
// Use named CKFinder browser route
filebrowserBrowseUrl: '@{{ route('ckfinder_browser') }}',
// Use named CKFinder connector route
filebrowserUploadUrl: '@{{ route('ckfinder_connector') }}?command=QuickUpload&type=Files'
} );
It is also possible to use CKFinder.setupCKEditor()
as shown below, to automatically setup integration between CKEditor and CKFinder:
var editor = CKEDITOR.replace( 'ckfinder' );
CKFinder.setupCKEditor( editor );
The sample below presents the result of the integration. You can manage and select files from your server when creating links or embedding images in CKEditor 4 content. In modern browsers you may also try pasting images from clipboard directly into the editing area as well as dropping images — the files will be saved on the fly by CKFinder.
To integrate CKFinder with CKEditor 5 all you have to do is pass some additional configuration options to CKEditor:
ClassicEditor
.create( document.querySelector( '#editor2' ), {
ckfinder: {
// Use named route for CKFinder connector entry point
uploadUrl: '@{{ route('ckfinder_connector') }}?command=QuickUpload&type=Files'
}
} )
.catch( error => {
console.error( error );
} );
The sample below presents the result of the integration. Try pasting images from clipboard directly into the editing area as well as dropping images — the files will be saved on the fly by CKFinder.
@stop @section('scripts') @stop