HI,
I am writing a bunch of template tags for a Django application, that need a certain javascript library.
Each of those template tags could exist multiple times on the same Template.
I was wondering if there is a smart way that I could add the Javscript library in the templatetag templates?
Here is an example TemplateTagA uses customA.js and TemplateTagB uses customB.js.
If I was to say put a extra javascript block tag with {{block.super}} (to not overwrite any other js's added), and TemplateTageA was used 3 times, customA.js would be added 3 times.
So that is not an ideal solution.
I could define in my Base Template a block tag for each script, but that would not be maintainable.
Any other ideas?
I have some more exotic ideas, like pull Javascripts source urls in an array, and then filter before downloading each one via Ajax.
However I am not sure if there are better approaches?
Looking forward to your responses...