Is there a way to set the FCK Editor Config["CustomConfigurationsPath"] from within CFML when I'm creating an instance the editor?
This would enable me to use multiple configs easily.
Thanks for your help!
This would enable me to use multiple configs easily.
Thanks for your help!

RE: Set CustomConfigurationsPath from ColdFusion
<cfscript>
fckEditor = createObjec("component", "fckeditor");
fckEditor.instanceName = "myEditor";
fckEditor.value = 'My content';
fckEditor.basePath = '/myApp/FCKeditor/2_3_1/';
fckEditor.width = '700';
fckEditor.height = '500';
fckEditor.toolBarSet = 'basic';
fckEditor.config = StructNew();
fckEditor.config.CustomConfigurationsPath = '/myApp/FCKeditor/allversions/FCKconfig.cfm';
fckEditor.create(); // create the editor.
</cfscript>
RE: Set CustomConfigurationsPath from ColdFus
I'm curious about your solution: I had expected that the CustomConfigurationsPath would point to a JavaScript file similar to config.js, where I could override selected editor settings.
How does config.cfm interact with/relate to config.js?
I wish there was better doc...
Thanks.
RE: Set CustomConfigurationsPath from ColdFus
Simply create a .cfm page and put this at the top:
<cfsetting showdebugoutput="no">
<cfcontent type="application/x-javascript">
Then you can use some cfif or cfcase statements for producing the config settings, like for example use another toolbar based on user privileges, etc...
RE: Set CustomConfigurationsPath from ColdFus
Excellent - thank you!
Allow me to hit you up for one final answer: What do you find is the best way to pass CF values to FCKConfig.cfm?
I have found that loading the URL doesn't work and that session variables do, but that's kind of ugly for passing multiple configs to be used in a single page view.
I've attempted setting another config variable when instancing the editor (like this: fckEditor.config.permutation = 'UseThisValue'; ) and then reading it via javascript in FCKConfig.cfm, but I haven't gotten that to work.
I'm guessing you've got this all figured out...
What's my best option for passing a simple, single value into the FCKConfig.cfm file?
RE: Set CustomConfigurationsPath from ColdFus
It all depends on what you want to do.
If you have like 3 different settings for your editor, you can just pass a url parameter like 'config.cfm?setting=1' and then inside config.cfm perform a <cfinclude template="setting#url.setting#.cfm">.
I'm not using multiple editors on one page, so I'm just using some application variables for the FCK settings.
Does this help you in any way?
RE: Set CustomConfigurationsPath from ColdFus
My challenge is that I'm instancing several editors on the same page. In this case, it's one for the article, one for the sidebar, and several more for image captions.
I'm attempting to tell each instance what toolbar, editorarea css, and headings to use.
I've tried this:
fckEditor.config.CustomConfigurationsPath = '#basepath#/CF_config.cfm?feats=#featureset#';
and it works fine except for that it appears to strip the 'URL.feats' parameter away. Feats has a character value such as 'article', 'sidebar', or 'caption'. In any case it is ignored.
When I use a session variable, it is observed, but unfortunately all editors on the page will observe the last session variable value set.
So I appear to be stuck.
Any thoughts?
RE: Set CustomConfigurationsPath from ColdFus
fckEditor.config.CustomConfigurationsPath = '#basepath#/CF_config_#featureset#.cfm';
Then you'll have to create 3 different config files, one for each featureset.
Does that work?
RE: Set CustomConfigurationsPath from ColdFus
fckEditor = createObject("component", "fckeditor");
fckEditor2 = createObject("component", "fckeditor");
fckEditor3 = createObject("component", "fckeditor");
Not sure, but it might cause some issues if you overwrite the same variable.
RE: Set CustomConfigurationsPath from ColdFus
fckEditor.config.CustomConfigurationsPath =
'#basepath#/CF_config_#featureset#.cfm'
I wouldn't call it elegant, but it is 100% effective. Thanks for thinking of that - I'm a bit embarrassed at it's simplicity (obviousness?).
By the way, I have instanced up to seven editors all with the same component (different instance names) on a single page with no conflicts. I have embedded the editor in a data maintenance framework that is driven by arrays of data column information. To create individually-named components might be tricky - I haven't tried setVariable() on components.
Excellent, Didgiman. Thank you.