Ok, so i got a problem and seen other with the same but no help so far.
Im using FCK editor with ASP and it works great except for changing the editors default language using a session variable.
If i use the following code in the fckconfig.js,
FCKConfig.DefaultLanguage = 'sv';
it has the swedish language, but when i try and put a session varable inside like this,
FCKConfig.DefaultLanguage = '<%=session("lang"%>';
nothing happens, not even an error and the editor stays in English.
I also made "autodetect language" to false.
What am i doing wrong?
(I have succesfully had this code run correct earlier but now i doubt that it did)
Im using FCK editor with ASP and it works great except for changing the editors default language using a session variable.
If i use the following code in the fckconfig.js,
FCKConfig.DefaultLanguage = 'sv';
it has the swedish language, but when i try and put a session varable inside like this,
FCKConfig.DefaultLanguage = '<%=session("lang"%>';
nothing happens, not even an error and the editor stays in English.
I also made "autodetect language" to false.
What am i doing wrong?
(I have succesfully had this code run correct earlier but now i doubt that it did)
RE: SET DYNAMIC LANGUAGE WITH ASP
var oFCKEditor = new FCKeditor( 'formcontent' );
oFCKEditor.Config['DefaultLanguage'] = '<%=session("lang")%>';
oFCKEditor.ReplaceTextarea();
RE: SET DYNAMIC LANGUAGE WITH ASP
Heres my code for showing the editor:
<%
sBasePath = rot& "webmanager/fckeditor/"
Set oFCKeditor = New FCKeditor
oFCKeditor.Height = 600
oFCKeditor.BasePath = sBasePath
oFCKeditor.Create "FCKeditor1"
%>
I tried also putting this in the above code:
oFCKEditor.DefaultLanguage = session("lang")
without success.
You seem to have a good eye for this, what else can i do to make this work?
Thank you for your posts
RE: SET DYNAMIC LANGUAGE WITH ASP
sBasePath = '<%=rot%>webmanager/fckeditor/';
set oFCKeditor = new FCKeditor;
oFCKeditor.Height = 600;
oFCKeditor.BasePath = sBasePath;
oFCKeditor.Config['DefaultLanguage'] = <%=session("lang")%>';
oFCKeditor.Create "FCKeditor1";
RE: SET DYNAMIC LANGUAGE WITH ASP
RE: SET DYNAMIC LANGUAGE WITH ASP
Feel free to post whatevwer idea you've got, thx.
RE: SET DYNAMIC LANGUAGE WITH ASP
And the result in the JS file came out <%=session("lang")%> hehe s ASP wont work inside the JS file... soooo, what if we could start some JS codes in the ASP page instead?
Will that work, and what codes should be used for that?
RE: SET DYNAMIC LANGUAGE WITH ASP
<%
sBasePath = rot& "webmanager/fckeditor/"
Set oFCKeditor = New FCKeditor
oFCKeditor.Height = 600
oFCKeditor.BasePath = sBasePath
oFCKeditor.Config("DefaultLanguage") = session("Lang")
oFCKeditor.Create "FCKeditor1"
%>
You can't put the vbscript in the fckconfig.js file unless your js files are being executed as ASP files.
RE: SET DYNAMIC LANGUAGE WITH ASP
I can say that the code above works like a clock for me.
I dont know how im going to thank you but you have truly made my work situation alot easier, and i bow down and say thank you m8!
I thought that it would be much harder then that and who could have guessed that the "Default Language" should be in () and the it should say Config ahead of it.