﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
11828	Content Templates Improvement	Chuck		"Templates are very useful, but if a site has a large number of templates or very complex templates, the load on the editor can get rather large. I would suggest an option to provide a URL as an alternative to the html variable. I have set this up in my own tests and this works well. In my example, it expects the return data to all be JSON arrays with the actual HTML in the ""result"" param, but it could also take raw HTML instead if needed.

In the template plugin, around line 50 there is currently this line...

item.on('click', function(){

I moved the insertTemplate call into an if statement, so now it reads this way...

                 if(template.url){
                    var hmtlData = '';
                    var ajaxOptions = {
                        async : false,
                        url : template.url,
                        success : function(data, status, xhr){
                            htmlData = data.result;
                        }
                    };
                    jQuery.ajax(ajaxOptions);
                    insertTemplate( htmlData );
                }else{
                    insertTemplate( template.html );
                }

Basically, if the chosen template has a URL, it will load via ajax (async off) and populates, rather than using the HTML attached. This also solves other issues, like needing to encode templates inside JS files or not being able to access HTML based templates from the server."	New Feature	confirmed	Normal		General	4.0			
