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
-
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
wow that was easy. It never even dawned on me to look at TinyMCE.
Thanks!
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