Passing data between modules used in the same template, global variables
Hey,
I would like a custom module to set a variable that would be visible for whole template that is using the module.
Example:
A custom module with Google Maps element including all the data for the map
Another custom module that creates a Google Map element
A template calling one or multiple custom modules with Google Maps elements
A template without any of those modules
A partial (footer) that is included in every template with JS code that calls Google Maps API and JS init function
What I would like to achieve is to have the JS code for Google Maps only when module that creates a map element is used in the template. Any ideas?
I thought that setting a variable inside the map module that the footer can detect would be perfect, but of course the variable is not visible outside the module.
Passing data between modules used in the same template, global variables
It does not really work for custom modules.
When using the custom module in my template like this: {% module "module_153363010948629" module_id="3490718" label="EDGE Map Big" export_to_template_context=True %}
the module dissapears from template preview and does not work at all.