I'm trying to get the coldfusion CFC working with an external config file but not having any luck.
It looks like when you call the cfc it doesn't even read the default fckconfig.js. If I create a struct and put in CustomConfigurationsPath I get a bunch of JS errors about unknown toolbar items.
Here it what my code looks like:
<pre>
<cfset fckconfig = structNew()>
<cfset structInsert(fckconfig,"CustomConfigurationsPath","/test/fckcustom.js")>
<cfscript>
fckEditor = createObject("component", "fckeditor");
fckEditor.instanceName = "content";
fckEditor.basePath = "/test/fckeditor/";
fckEditor.value = "";
fckEditor.width = "750";
fckEditor.height = "500";
fckEditor.config = "#fckconfig#";
fckEditor.create(); // create instance now.
</cfscript>
</pre>
the /test/fckcustom.js is just a copy of the fckconfig.js that comes with fckeditor, I changed the skin to see if it actually loads, but it doesn't.
Any help/examples would be appreciated. Thanks.
It looks like when you call the cfc it doesn't even read the default fckconfig.js. If I create a struct and put in CustomConfigurationsPath I get a bunch of JS errors about unknown toolbar items.
Here it what my code looks like:
<pre>
<cfset fckconfig = structNew()>
<cfset structInsert(fckconfig,"CustomConfigurationsPath","/test/fckcustom.js")>
<cfscript>
fckEditor = createObject("component", "fckeditor");
fckEditor.instanceName = "content";
fckEditor.basePath = "/test/fckeditor/";
fckEditor.value = "";
fckEditor.width = "750";
fckEditor.height = "500";
fckEditor.config = "#fckconfig#";
fckEditor.create(); // create instance now.
</cfscript>
</pre>
the /test/fckcustom.js is just a copy of the fckconfig.js that comes with fckeditor, I changed the skin to see if it actually loads, but it doesn't.
Any help/examples would be appreciated. Thanks.
RE: Coldfusion and external config files
<script type="text/javascript" src="/FCKeditor/fckeditor.js"></script>
<cfscript>
fckEditor = createObject("component", "/FCKeditor/fckeditor");
fckEditoe.Config[ "CustomConfigurationsPath" ] = '/FCKeditor/customConfig.js' ;
fckEditor.instanceName = "textEditor";
fckEditor.value = '#getPage.pageText#';
fckEditor.basePath = "/FCKeditor/";
fckEditor.width = "100%";
fckEditor.height = 500;
fckEditor.create(); // create the editor.
</cfscript>
RE: Coldfusion and external config files
I've just got 1 line in the customConfig.js file:
FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/silver/' ;
I put that in as a test, I figured I could easily tell if its reading the file.
RE: Coldfusion and external config files
If it is not loading the customConfig, it might be the cache. For some reason even clearing it doesn't really work for some of this stuff, so switching between FF and IE _really_ helps, as they use seperate caches. Rebooting seems to be good for debugging as well.
Long and short is, with the code following, it loads the customConfig.js but doesn't load the toolbars in NS or Firefox. IE seems to work tho.
If you could try it with both and see if it works for you in IE, i'd appreciate it.
<cfscript>
fckEditor = createObject("component", "/FCKeditor/fckeditor");
fckEditor.instanceName = "textEditor";
fckEditor.value = 'hola';
fckEditor.basePath = "/FCKeditor/";
fckEditor.width = "100%";
fckEditor.height = 500;
fckEditor.config["CustomConfigurationsPath"] = '/FCKeditor/customConfig.js';
fckEditor.toolBarSet = 'PluginTest';
fckEditor.create(); // create the editor.
</cfscript>
RE: Coldfusion and external config files
After clearing cache and removing a plugin that was causing the toolbar to not display in Firefox(don't know what it was... just crappy code I guess) everything works as expected.
Changing skins seems to take several cache clearings/refreshings before it suddenly applies itself however. YRMV.
RE: Coldfusion and external config files
That worked, I was using FF and for some reason the skins don't work from the config file, but the toolbars do (what I really wanted anyways).
Thanks for the help.