-
☆ A M B ☆
- 24,524 Posts
You could use a snippet, including the barcode library, fetching the content of the TV and generating the barcode image on-the-fly.
You could use a plugin to generate the image on the onDocFormSave event, using the barcode generator library in the plugin code and saving the image to a file (if this library has that functionality).
https://forums.modx.com/thread/82231/plugin-for-reading-the-template-variable-tv-and-save-data-after-ondocformsave-user-profile-extended-fields
This sample code is for changing a TV's value, but you can see from it that the TV value is available on the onDocFormSave event as
$resource->getTVValue(1) //the old value (using id of tv)
https://gist.github.com/christianhanvey/2768300
You would use the same getTVValue(xx) to get the value of the barcode TV, then include the barcode library, and generate the image, saving it to wherever you want.
Thanks, but its a bit complicated for me. Dont have such a deep knowledge of Modx to write a code myslef. Could you be please more specific?
-
☆ A M B ☆
- 24,524 Posts
If you know PHP, it's just a matter of using the barcode library in a snippet's code. If you don't know PHP, then you will probably need to hire somebody to do it for you.
-
☆ A M B ☆
- 24,524 Posts
That link is for vb.net, a different language than PHP.