HTML Content Template with embeded Script

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
6/28/2018 7:50:36 AM
Gravatar
Total Posts 70

HTML Content Template with embeded Script

I am working on some HTML Content Templates that involve mapping and would like to embed a script tag associated with the mapping.  The idea would be to create maps centered certain regions that I don't have to continuously reproduce. Is this possible or would I have to include a script module on each page I used the mapping?

 

It would be something similar to this 

<div class="map-wrapper">

<div class=".mapregion">

</div>

<script>

var map = new MapAPICall({
                                    tagId: '.mapregion',
                                      center: [ -94.783516, 36.604737],
                                    zoom: 10,
                                    Key: '123456,
                                    ZoomControl: false                            
                                   
                                });

</script>

</div>

 

7/3/2018 5:40:53 PM
Gravatar
Total Posts 216
Community Expert

mojoPortal Hosting & Design @ i7MEDIA!

Re: HTML Content Template with embeded Script

Hi,

If I understand correctly, you could use SuperFlexi for this. The superflexi would include the markup you placed below in the markup definition, but the values of the tagId, center, zoom, Key, and ZoomControl arguments would be replaced with tokens, and then you would build the field definition with options - you would still have to manually publish the SuperFlexi to each page but it would be easier. Also, you could create a map in your JS between the "region" and the "center" values, so that when you add the map to the page you would just have to select the region from a pre-populated dropdown and the "center" value would be automatically plugged in.

Depending on what map system you're using (google, mapquest, etc) the amount of this that can be determined programmatically will differ considerably.

You must sign in to post in the forums. This thread is closed to new posts.