We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15393
    • 1 Posts
    I am looking for a system event that is called when a document is moved.

    My plugin, automaticTpl is using OnDocFormPrerender to set the template of a new document.

    I would also like to change the template of the document when it is moved. I know it’s not a "nice" thing to do but I was wondering if it is possible.

    Thank You
      • 3749
      • 24,544 Posts
      By "moved" do you mean when the parent is changed?

      If so, I think you’d need a plugin listening to OnBeforeDocFormSave that would compare the parent of the document about to be saved with the one stored for that doc in the DB. If they don’t match, you could change the template.
        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
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        I don’t believe the move_document.processor.php invokes any of the events. So such a plugin would only work if the document is moved from the full document edit form, but not when it is moved from the context menu option.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org