11

Installed CKEditor and CKFinder in a Laravel project, both in the Public/js folder

In my main page, I load a site specific .js file which contains

var CKEDITOR_BASEPATH = '/js/ckeditor/';

Also tried:

var CKEDITOR_BASEPATH = 'http://localhost:8888/js/ckeditor/';

Then I load my ckeditor.js file

From my /Resources/Views/admin/newpage.blade.php view, I load up a text box and call CKEditor.replace(). Does it perfectly. I can add a new page, even edit them.

Problem occurs when I try to use the Browse server buttons, it tries to load the plugin from /admin/ckeditor/plugins/... instead of /js/ckeditor/plugins/...

I have a feeling its something simple I am missing, but just not sure what. Any thoughts?

Keith Clark
  • 609
  • 1
  • 7
  • 19
  • Did you set the `basePath` property of `CKEDITOR.plugins` manually? Or adding an external resource like `CKEDITOR.plugins.addExternal('someNameForThePlugin', CKEDITOR_BASEPATH + '/js/ckeditor/', 'scriptFile.js')` and then add it as a extra plugin in the editor configuration? Check this: http://ckeditor.com/forums/CKEditor-3.x/Tutorial-create-external-plugin-for-CKEDITOR – Alejandro Iván Dec 15 '16 at 15:11

3 Answers3

3

you have to write full address to file file this

<script>
  window.CKEDITOR_BASEPATH = 'http://example.com/path/to/libs/ckeditor/';
</script>
Pedram marandi
  • 1,474
  • 1
  • 19
  • 35
1

use Symfony-2 laravel5 composer

Gowthaman D
  • 574
  • 7
  • 19
0

I had a similar issue with laravel and CKEditior.

The difference is I was facing this in plugin folder to give the icon of my custom button

icon: this.path + 'mypath'

solved my issue.

So you may also have to append your path after this.path

Hope it will sove yours too.

Cybersupernova
  • 1,833
  • 1
  • 20
  • 37