Replies: 1 comment 2 replies
-
Featurebox uses this approach - each template key can have its own javascript. This is nice for the initialization of some scripts too. But from this approach, it was moved to behaviors. Actually, gallery plugin has an issue with the initialization of photo gallery and I am not able to fix it. It is too complicated now. I am using for this plugin preference to load only needed JS if it depends on the template or so. For example, the theme can use the same script as your plugin template and it would be loaded 2x. And I think you can use e107::js in the template file too. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a plugin with a template design that has some jscript to make it more "user friendly", but the same purpose can be anchieved without any jscript. RIght now the jscript is loaded with e107::js at the logic file, ie plugin,php, but i was wondering, since jscript is a client side scripting, and perhaps has more to do with presentation than logic, couldn't or shouldn't jscript be template dependent and be loaded only if the template explicity it? It could even be jscripts code that the template designer wants to use, and there's no need to mess with the plugin core php file...
Or there's no need for the core php file load jscripts that the template might or not might use....
Just my thoughts....
Beta Was this translation helpful? Give feedback.
All reactions