Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Passing data between modules used in the same template, global variables
Participant
Aug 14, 2018 4:46 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content