We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3232
    • 380 Posts
    I don’t see much documentation on plugins and looking around the forums I couldn’t find an example so I figured I would post this thread.

    I am looking to modify a TV (text area) before a document save.

    Does anyone know of any plugins that modifies (or retrieves the value, modify it and save) a TV value or have an example that I can look at?

    Thanks in advance,
    Brian
      • 25663 MODX Staff
      • 12,272 Posts
      Look at the provided TinyMCE which does exactly that: modifies a text area.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 3232
        • 380 Posts
        wow that was easy. It never even dawned on me to look at TinyMCE.

        Thanks!
          • 3232
          • 380 Posts
          So after taking a look at the plugin...

          I understand how to handle the different events. I believe in order to edit something before save but after the update/insert, I should be using a case for OnBeforeTVFormSave, does that sound right?

          Once thing that I don’t see in the TinyMCE plugin (I am probably just missing it) is how the data is sent to the plugin. Is everything stored in an array "$elements"?

          Once I retrieve the value of a tv and modify it, how would one send it back to be "processed"?

          Thanks
          Brian
            • 3232
            • 380 Posts
            I was able to achieve what I wanted after look at this post:

            http://modxcms.com/forums/index.php/topic,27829.0.html