I need to allow different users on my site to access different style sheets. The path to these is:
basedir/#session.usersDir#/style.css
Using Coldfusion (though I'm pretty sure this should be able to be answered by non CF users), I tried the following:
<cfscript>
fckEditor = createObject("component","admin.FCKeditor.fckeditor");
fckEditor.instanceName = "myEditor";
fckEditor.ToolbarSet = 'mytools' ;
fckEditor.value = myCode;
fckEditor.basePath = mybasePath;
fckEditor.StylesXmlPath='/#session.relPath#styles.xml' ;
fckEditor.width = "100%";
fckEditor.height = 400;
fckEditor.create();
</cfscript>
When doing this the FCK editor won't display. If I take one of the #session.relPath# values and hardcode it in fckconfig.js as :
FCKConfig.StylesXmlPath='/testuser/styles.xml'
it works perfectly, so it doesn't seem to be the path that is wrong.
Am I even able to change StylesXmlPath when I initiate the editor? Or is there another way to achieve this same thing?
basedir/#session.usersDir#/style.css
Using Coldfusion (though I'm pretty sure this should be able to be answered by non CF users), I tried the following:
<cfscript>
fckEditor = createObject("component","admin.FCKeditor.fckeditor");
fckEditor.instanceName = "myEditor";
fckEditor.ToolbarSet = 'mytools' ;
fckEditor.value = myCode;
fckEditor.basePath = mybasePath;
fckEditor.StylesXmlPath='/#session.relPath#styles.xml' ;
fckEditor.width = "100%";
fckEditor.height = 400;
fckEditor.create();
</cfscript>
When doing this the FCK editor won't display. If I take one of the #session.relPath# values and hardcode it in fckconfig.js as :
FCKConfig.StylesXmlPath='/testuser/styles.xml'
it works perfectly, so it doesn't seem to be the path that is wrong.
Am I even able to change StylesXmlPath when I initiate the editor? Or is there another way to achieve this same thing?
RE: Dynamically set StylesXmlPath
If not, your setting would be
FCKConfig.StylesXmlPath='/testuserstyles.xml'
and not
FCKConfig.StylesXmlPath='/testuser/styles.xml'
Just a quick question to make sure before we take this further...
RE: Dynamically set StylesXmlPath
iam not CF pro, but the line
fckEditor.StylesXmlPath='/#session.relPath#styles.xml' ;
look preety suspicious to me. Did you try
fckEditor.Config['StylesXmlPath']='/#session.relPath#styles.xml' ;
and then read it from fckEditor.Config.
?
RE: Dynamically set StylesXmlPath
The way I solved this (I'm using php and mysql) is to replsvr the xml file with a php file.
Then in the php file, I serve up dynamically what ever style elements I want.
Note: I also had to dynamically set the editor/css/fck_editorarea.css by converting it to a php page as well.
It works... and I have dynamically built styles in the editor. My method is likely more complex than you need, but I needed style info that is pulled from a database. Hope this helps.