blueimp/JavaScript-Templates

Using template on multiple classes

Closed this issue · 1 comments

Hi @blueimp,

I'm using your Jquery file upload on with the basic ui plus version on my website, which includes javascript-templates.

I'm trying to get another script the same as the <script id="template-download" type="text/x-tmpl">...</script> but with being sent to a different class and slight changes within the script.

I just wondering what would be the easiest way to accomplish this between the editing the scripts in the index.html and the jquery.fileupload-ui.js?

If you want to render a different template depending on the response data, I suggest you implement a switch in the download template itself.
If you want to separate the two scripts, you can make use of the include template command.

Please read up on the Templates documentation on how to do so:
https://github.com/blueimp/JavaScript-Templates/blob/master/README.md#api