Bug reports Found a bug? Post it here please.
Version 4.x > Bug reports > FCKEditor Templates work in IE or Firefox but not both View modes: 
User avatar
Member
Member
jlarios-uwb - 9/8/2009 11:12:27 AM
   
FCKEditor Templates work in IE or Firefox but not both
In CMSAdminControls/FCKEditor/editor/dialog/fck_template.html there's some code which confuses me:

/* CMS */
if(FCKBrowserInfo.IsGecko)
{
oXml.LoadUrl('../' + FCKConfig.TemplatesXmlPath) ;
}
else
{
oXml.LoadUrl(FCKConfig.TemplatesXmlPath) ;
}
/* CMS end */

With this code (which isn't how it is in the standard FCKEditor distribution), I don't see how the template function is supposed to work in both IE and Firefox. I can't put a path anchored to the document root in FCKConfig.TemplatesXmlPath, because the leading '../' will screw it up. Adding or removing '../' to the templatesxmlpath value makes the feature work in IE or Firefox, one at a time, but not both at the same time.

I'll do some more testing to confirm, but I think the IsGecko test should just be removed, and have it only lead the FCKConfig.TempalteXmlPath, without that leading '../'.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 9/9/2009 4:01:19 AM
   
RE:FCKEditor Templates work in IE or Firefox but not both
Hi,

In the FCKConfig.TemplatesXmlPath key is stored the path to the FCKTemplates.xml file, where the templates are stored.

But you can change the configuration in fckconfig.js file, where around line 239 is this code:

FCKConfig.TemplatesXmlPath = '../fcktemplates.xml' ;

and here you can change the path as you need to. Or, you can use

FCKConfig.TemplatesXmlPath = FCKConfig.BasePath + '<path>' ;


I hope it will help.

Best Regards,
Juraj Ondrus

User avatar
Member
Member
Josh Larios - 9/9/2009 12:15:06 PM
   
RE:FCKEditor Templates work in IE or Firefox but not both
FCKConfig.TemplatesXmlPath = FCKConfig.BasePath + '<path>' ;

In fact, using that exact configuration is what alerted me to the problem in the first palce.

When you combine that setting with this code:

oXml.LoadUrl('../' + FCKConfig.TemplatesXmlPath) ;

what you get is an attempt to load '../http://our.kentico.url/CMSAdminControls/FCKeditor/fck_template.html', which is clearly wrong.

I really think the problem is in lines 98-107 of CMSAdminControls\FCKeditor\editor\dialog\fck_template.html -- I don't see any way that the configuration change you've suggested here could possibly work, given that Gecko browsers are being told to prepend '../' to the FCKConfig.TemplatesXmlPath value before loading it.

User avatar
Member
Member
Josh Larios - 9/13/2009 1:33:56 PM
   
RE:FCKEditor Templates work in IE or Firefox but not both
Woop, sorry. I meant to say that it tries to load '../http://our.kentico.url/CMSAdminControls/FCKeditor/fcktemplates.xml'

Either way, that leading '../' is wrong, and it's something that a standard FCK install doesn't do, but the one in Kentico does.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 9/16/2009 2:26:58 AM
   
RE:FCKEditor Templates work in IE or Firefox but not both
Hi,

The path should be relative, so if you will enter somewhere absolute path "http:..." it will add the "../", which is clearly wrong, as you mentioned.

Have you made any changes to the base path property? This setting is being set in web.config file using this key:

<add key="FCKeditor:BasePath" value="scripts/FCKeditor" >


If this key is not specified, that the devault path is used "/scripts/FCKEditor".

Best Regards,
Juraj Ondrus

User avatar
Member
Member
Josh Larios - 9/16/2009 3:55:59 AM
   
RE:FCKEditor Templates work in IE or Firefox but not both
Hmm, I think I see. My original problem probably had to do with a browser cache, and it would have worked if I'd cleared it. I'll test this in a clean instance tomorrow to make sure, but I guess as long as you use a relative path it should work. I don't think FCKConfig.EditorPath is relative, because I haven't changed the BasePath at all, and I'm pretty sure that it's trying to request "../http:.//blah blah" when I use Firefox. That is, I'm not specifying "http://"; it's coming from FCKConfig.EditorPath. But I'll double check that tomorrow. Maybe this isn't a problem after all.