Is there an accepted way for getting form submissions published directly as a resource?
I’m wanting to set up a very small neighbourhood site where people can send details of local tradespeople via a form which then creates an unpublished resource that I can then check and publish if acceptable.
Formit2Resource just uses $modx->newObject('modResource'); which is the normal way of creating a new object in MODx.
I’d use this snippet as a starting point and then customize it to your needs.
Alternatively you could call the “resource/create” processor $modx->runProcessor('resource/create',$values); if you have plugins that need to run on certain events (like ‘OnBeforeDocFormSave’ or ‘OnDocFormSave’) for this new resource.
I think a big question is if you want anonymous users to be able to view and submit the form.
If not, NewsPublisher does everything you need it to do and is actively updated and maintained by Bob Ray. Is a bit of a set up as you would imagine, highly configurable, the docs are great, and he is responsive if you get stuck.
If the form is publicly available you could reduce the security risk and the complexity by saving the Formit submissions, exporting them as .csv and using ImportX to create new resources from the rows in your (vetted) .csv file.
Thank you all. I’ve just got a basic version up and running using Formit with Formit2Resource. All seems to be working fine except the form redirect which I will sort out in due course.
The whole site will be password protected - just for use in the local community so I’m confident security will be fine.