Totally Zenned
- Join Date:
- Aug 2007
- Location:
- Gijón, Asturias, Spain
- Posts:
- 2,876
- Plugin Contributions:
- 7
Encapsulated plugin, observer class loading javascript
I'm working on making Structured Data as an encapsulated plugin.
Previously it was a jscript file that's autoloaded by the template head and gets most of its data from the various globals that are already in existence at that point.
When in the encapsulated plugin, it is included by an observer watching the end of the head.
In this scenario I find that the same jscript file does not have access to the same globals (e.g. $breadcrumbs): each one has to be declared as global prior to the include in the observer.
Any way to avoid or simplify that/an alternative method?
Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...