Customize baseUrl and baseDir in CKFinder
- by Nick Petrie
We use CKEditor and CKFinder for Coldfusion in many of our CMS applications. These apps point to different sites on our server, so we want CKFinder setup to upload files to directories specific to each app. But we one want one shared location for the CKEditor and CKFinder files on the server.
In the config.cfm file, we have setup the default baseURL and baseDir like this:
config.baseUrl = "http://www.oursite.com/_files/site1/ckfinder_uploads/";
config.baseDir = '\\ourserver01\_files\site1\ckfinder_uploads\';
In the header file for each app, we include the following to instantiate CKEditor and CKFinder (including the jQuery adapter):
<script type="text/javascript" src="/shared/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="/shared/ckeditor/adapters/jquery.js"></script>
<script type="text/javascript" src="/shared/ckfinder/ckfinder.js"></script>
<script type="text/javascript">
$(document).ready(function(){
CKFinder.setupCKEditor( null, '/shared/ckfinder/' );
});
</script>
When I open a CKFinder window in one of the apps, it correctly opens to the default baseURL/baseDir. However, how can I override those defaults? I tried changing the CKFinder setupCKEditor function to this following with no luck:
CKFinder.setupCKEditor( null, { basePath:'/shared/ckfinder/', baseUrl:"http://www.oursite.com/_files/NEWSITE/ckfinder_uploads/", baseDir:"\\\\ourserver01\\_files\\NEWSITE\\ckfinder_uploads\\" } );
It just ignored this and used the defaults. Thoughts? Thanks!!