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

    • MODX Version: 2.2.11
    • Installed MODX Add-ons: Gallery 1.5.2

    Just started out with MODX a couple of weeks ago, still have a lot of learning to do, so maybe I've missed how to do this, but it seems that when you add/update items in Gallery, a refresh of the cache is necessary to allow the images to show up on the front end (which makes sense, of course). Supposing I'm putting together a website for someone who doesn't understand that concept, though, ("What's a cache? Why do I need to do this?") is there a way to automate that process when the user submits a new image or updates an existing one? Is it even advisable to try it?

    Thanks for your help! Really enjoying working with MODX so far.
      • 3749
      • 24,544 Posts
      I don't have the current version of Gallery, but in the version I have, Gallery doesn't appear to fire any System Events when an image is uploaded and I don't see any System Event that would be called for that, which would mean there's no easy way to do it. Maybe I'm missing something.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 4172
        • 5,888 Posts
        maybe its possible to hook into the OnManagerPageInit - event.
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 46612
          • 2 Posts
          Quote from: BobRay at Feb 15, 2014, 08:32 PM
          I don't have the current version of Gallery, but in the version I have, Gallery doesn't appear to fire any System Events when an image is uploaded and I don't see any System Event that would be called for that, which would mean there's no easy way to do it. Maybe I'm missing something.

          Thanks for the information! (And also, thanks for the guides you've written, they were immensely helpful in getting me started with MODX. smiley ) Maybe someone else can come up with an automated solution, but until then, I'll just explain to any prospective clients how it works.

          Ah, just saw your reply, Bruno17: I'll take a look at that. Might be a little over my head at this point in time.
            • 3749
            • 24,544 Posts
            I'd suggest making a feature request for Gallery (and maybe some other photo gallery extras) to have them create an event called OnUploadFiles and/or OnUpLoadFile on installation and fire the event(s) in their code.

            It should be relatively easy for an extra author to add this feature and it would allow people to create plugins like the one you need.

              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting