TinyMCE - Predefined Template Content

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 years ago
Tryed in IE10, Chrome, Firefox.

Remember to empty your cache, since it might contain an old version of your .js (template_list.js) or tinyMCE files.

And make sure the template files are stored in an folder/path others can read from.
11 years ago
I emptied my cache on both IE and Chrome when I noticed the problem and it didn't have any effect on the templates being imported. I'll download and try IE10.
11 years ago
OK, I found the problem. IE 10 doesn't do any better with this than IE9 or Chrome. The problem is HTTP access control. Apparently when tinymce script requests the template it drops the www from the URL. This is handled fine in Firefox. But IE9-10 and Chrome take issue with it because a URL with a www is different from a URL without for these two browsers (security features) Chrome was generating the following message:    XMLHttpRequest cannot load http://www.mysite.com/content/templates/Classes.html. Origin http://mysite.com is not allowed by Access-Control-Allow-Origin. IE was something similar.

I can fix it by removing the www from the URL's. This brings the templates into IE and Chrome. Unfortunately then Firefox doesn't work. As I have limited amount of experience I'm not too sure if I can include both types of URL's so it works in all browsers? If I can, I would appreciate any help. For example how would I code the following line to include www.mysite.com for Firefox and just mysite.com without the www for IE and Chrome?

var tinyMCETemplateList = [
  // Name, URL, Description
    ["Classes",

"http://mysite.com/content/templates/Classes.html","Classes"],
];
11 years ago
Hmm i'll have a look at it and post back :)
11 years ago
Thanks a bunch. Apparently there is some code that can be added to the web server if you have access. My sites are hosted and I don't have access. This may be why your examples work in all three browsers and mine don't. Thank you for your help! After researching a bit more I think I'm going to advise my folks to use IE or Chrome if they want to use the templates. Maybe providing additional code for Firefox is working around security...not a good idea.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.