I wanted to create a custom FCKConfig variable to define a specialised path I was using in a plugin. This was so I could define the path when I created the editor and then use it in the plugin. I found one way of doing this (courtesy of a post whose author I can't remember), which is:
When declaring FCKeditor:
<cfscript>
//usual initiating vars
fckEditor.myVar = 'myvalue';
//rest of usual initiation
</cfscript>
Then in the fckeditor.cfc:
Where the other CFPARAMs get initiated:
<cfparam name='this.myVar' default=''>
Then where the sURL value is set (around line 154 in the cfc):
sURL = this.basePath & "editor/fckeditor.html?InstanceName=" & this.instanceName;
Add myVar to the URL:
sURL = this.basePath & "editor/fckeditor.html?InstanceName=" & this.instanceName & 'myVar=' & this.myVar;
Now on fckconfig.js add:
FCKConfig.myVar = FCKURLParams['myVar'];
This seemed to work OK - however it seems to be quite a round-about route (also, I don't know if there is a limit to the length you can make that sURL value either, so it may only take a few vars) to add a custom FCKConfig var - is there an easier way?
Or a completely obvious way of achieving the same thing that I've missed?
When declaring FCKeditor:
<cfscript>
//usual initiating vars
fckEditor.myVar = 'myvalue';
//rest of usual initiation
</cfscript>
Then in the fckeditor.cfc:
Where the other CFPARAMs get initiated:
<cfparam name='this.myVar' default=''>
Then where the sURL value is set (around line 154 in the cfc):
sURL = this.basePath & "editor/fckeditor.html?InstanceName=" & this.instanceName;
Add myVar to the URL:
sURL = this.basePath & "editor/fckeditor.html?InstanceName=" & this.instanceName & 'myVar=' & this.myVar;
Now on fckconfig.js add:
FCKConfig.myVar = FCKURLParams['myVar'];
This seemed to work OK - however it seems to be quite a round-about route (also, I don't know if there is a limit to the length you can make that sURL value either, so it may only take a few vars) to add a custom FCKConfig var - is there an easier way?
Or a completely obvious way of achieving the same thing that I've missed?
