简体   繁体   中英

CKEditor & CKFinder path issue

I have already search this problem on Stack Overflow but I didn't find an answer, please help me.

I have set my upload folder succesfully with no problem, but there is an issue...

Here is my folder structure.

httpdocs
|--pracitce
|  |--module
|  |  |--ckedtior(folder)
|  |  |  |......
|  |  |  |......
|  |  |--ckfinder(folder)
|  |  |  |......
|  |  |  |......
|  |--news
|  |  |--ckinder(folder) <<< force to copy "ckfinder" folder here   
|  |  |--news_list.php
|  |  |--news_add.php

I can call CKEditor at new_add.php replace <textarea></textarea> but when I use CKEditor editing my article and click the Image button to upload my pictures I can't call CKFinder with right path.

The new tab will be:

..../news/ckfinder/..........

it should be

 ..../module/ckfinder/..........

Can someone tell me how to set this path?

Screenshot:

It force me to copy CKFinder to my news folder for solve this problem. But I don't think it's a good idea to doing that.

I just need to know how setting my CKFinder path in CKEditor, maybe in ckeditor.js / config.js ... or somewhere else...

BTW.. there is the way I replace my <textarea>

<script type="text/javascript">
var editor = CKEDITOR.replace("content");
CKFinder.setupCKEditor( editor, '<?=$admin_real_path?>/_module/ckfinder/' ) ;
</script>

And

In this sentence , it doesn't work!! I take a sample on Internet.. $admin_real_path it's my webiste_admin_path is work , I am sure about this.

CKFinder.setupCKEditor( editor, '<?=$admin_real_path?>/_module/ckfinder/' ) ; 

Please Help!!!!!

Thanks for updating the question. I created a directory structure similar to yours:

├── module
│   └── ckfinder (CKFinder files inside)
└── news
    └── list.html

list.html

<!DOCTYPE html>
<html>
<body>

<textarea id="content"></textarea>

<script src="//cdn.ckeditor.com/4.5.6/standard-all/ckeditor.js"></script>
<script src="../module/ckfinder/ckfinder.js"></script>
<script>
    var editor = CKEDITOR.replace('content');
    CKFinder.setupCKEditor(editor, '../module/ckfinder/');
</script>
</body>
</html>

With CKEditor and CKFinder configured like above everything works fine. I believe there's an issue with incorrect path in your code. In directory listing the name of the folder is module , while in the code you used _module .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM