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?
Bookmarks