We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29774
    • 386 Posts
    Hi

    I’ve written a MamagerManager widget to output a Googlemap within a manager page with a draggable marker that dynamically updates a longitude and latitude field, and cit also provides geocoding using any address, city, zip fields in the same template. It’s all working great but only if I hardcode the Google map script include code in the manager header template. Trying to include the script using jQuery’s getScript() or simply by writing the <script> tags with javascript simply doesn’t work - Google’s code needs to be included before DOM isReady(). My question is, is there a way to include scripts in the manager in the same way you can on the front end with $modx->regClientStartupScript() ?

    http://www.flickr.com/photos/perfectfool/3266638546/sizes/o/
      Snippets: GoogleMap | FileDetails | Related Plugin: SSL
    • Did a geocoding widget almost exactly the same as that recently - didn’t use ManagerManager though.

      We used a plugin attached to the ’OnDocFormPrerender’ event with output buffering and then manipulated the various DOM elements using jQuery to get the TV widget showing in the right place.
        Garry Nutting
        Senior Developer
        MODX, LLC

        Email: [email protected]
        Twitter: @garryn
        Web: modx.com
      • We couldn’t get it to work in ManagerManager either, but the plugin did indeed work well as Garry mentioned.
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 29774
          • 386 Posts
          OK thanks guys. I’d still like to keep it as a widget within MM - it just seems right as I use MM all the time to customize the manager- so I’ll write a simple plugin to include Google’s code without needing to hack the manager template.
            Snippets: GoogleMap | FileDetails | Related Plugin: SSL