Has anyone got a EB code snippet (or a how to) to allow me to provide users the ability to place several instances of the same extension on a page but only call in the jQuery file once?
Paul
Aditerum - No longer supporting WWB extensions - refer to CJS. Aditerum - No longer supporting WWB templates - refer to CJS.
WWB 9.4; Ext Builder 4.2; Windows 10 64bit; Intel Core i7-3770 Processor 3.40Ghz; 16.0Gb RAM Death to Internet Explorer!
Hi Paul I use this for the Youtube fancybox extension, note the two ID's (in red) one ID for a Div to surround the main Div of the Youtube/image the other ID for the image used. This allows the user to set the ID for each extension usewd with this extension and only uses one set of scripts
And if the extension is used 2 or more times the resulting HTML generates 2 or more lines of <script src="LiquidZoom/js/liquid-zoom.js">.
What I am trying to implement is a method to write <script src="LiquidZoom/js/liquid-zoom.js"> just the once, no matter how many times the extension is used on a page.
Aditerum - No longer supporting WWB extensions - refer to CJS. Aditerum - No longer supporting WWB templates - refer to CJS.
WWB 9.4; Ext Builder 4.2; Windows 10 64bit; Intel Core i7-3770 Processor 3.40Ghz; 16.0Gb RAM Death to Internet Explorer!
Hmmm well with the Youtube fancy box extension I know I can add more than one simply changing the ID for each one used and I only ever get one instance of the css/js file used. If you were to install my Extension of Youtube Fancybox you will see that this is the case
Sorry Bacon, still confused by this...oh and thanks for the birthday cake
Each use of the extension (Liquid Zoom) will run through the file and dump the contents of the <head> into the generated html, so I'll see the following:-
The trick is to make sure the header code is the same for all instances of the extension , so there should not be any variables in it.
In your case, put
<script src="LiquidZoom/js/liquid-zoom.js"></script>
between the head tags and move
<link rel="stylesheet" href="LiquidZoom/css/liquid-zoom-$uiid$.css" type="text/css">
to the body