We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 53452
    • 12 Posts
    Thank you Andy and to anyone else that cares to take a look at this. It makes my head spin. smiley
      • 38783
      • 571 Posts
      Going back a bit you mentioned that the sample map does not work either. Do you get a similar error showing up when you publish the sample map?
        If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

        email: [email protected] | website: https://andytough.com
        • 53452
        • 12 Posts
        Success! After struggling with this all day, I slept on it and woke up with the realization that all I needed was a new Chunk!

        My template contained the chunk named head-tag, which is where I added the <script> information that points to the .js files.
        My template did not contain a chunk to pull in the actual map and show it. So I created a new chunk and added in the <div id="map"></div>, added this new chunk to my template and Voila! I have a map.

        I've figured out how to center the map on the page but now i just need to figure out how to move it up closer to the top as there is too much white space above it. The settings for this (and all my pages/templates) are controlled by a css I presume and I don't want to modify any of the other pages. Is there a way to only apply special settings to that page or area (i.e., override the default settings)?

        Thank you! Thank you! Thank you for all your help!!
          • 46886
          • 1,154 Posts
          you can use css to move the map up a bit, I believe you can give the div a class name and use that to control styling, give it something like margin-top:-10px; and see what happens. That negative margin has the ability to pull the map up

          Sometimes you have to compromise a bit on spacing unfortunately
            • 38783
            • 571 Posts
            Well done! It's amazing what walking away from a problem and getting some sleep can do isn't it.

            I had not noticed, when I suggested you place the map in your content area that your template did not have the MODX content area specified in it.

            Your content area is like this
                <!-- PAGE CONTENT -->
             
                <section class="top">
                    <div class="container">
             
                         
                        [[$page-info]]
             
             
             
                    </div><!--end container-->
                    </section>
             
             
             
             
                 
                <!-- PAGE CONTENT END-->


            Which means that you have a chunk called page-info that contains all the existing page content.

            The only drawback to having the map on the template is that every page that uses that template will have the map on it. So you would need two templates. One for pages with the map and one for pages without the map.

            If your page content area contains the MODX tag [[*content]] then placing <div id="map"></div> on the map pages (resource) content area would have worked. However, if this template is unique to your map page you will be OK!

            <!-- PAGE CONTENT -->
             
            <section class="top">
                <div class="container">
             
                      
                    [[$page-info]]
                    [[*content]]
             
             
                </div><!--end container-->
                </section>
             
            <!-- PAGE CONTENT END-->


            I suppose the page-info might contain [[*content]]? Although if it does I would expect the map to have appeared correctly the first time.


              If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

              email: [email protected] | website: https://andytough.com
            • Kind of unrelated, but seeing how you specifically mentioned version 2.4.0: please upgrade your site to 2.6 while you're working on it wink You're missing important security fixes that came with 2.5.2.
                Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.