This is a bit 'complex'. I'm using a plugin OnPageNotFound wich i use to redirect to a specific page after some checks when someone visits a dynamic build page with soap data. Now i have a contact form, for one of the generated items. All the paths that correspond with a custom function which generates a furl are send to one resource id, so
foo/bar/100/baz
is a page not found, the plugin kicks in, gets the 100 (item id), makes our soap call, if object exists and the faux path created trough our function is identical to the one being visited, the plugin makes a $modx->sendForward() to one resource used for all soap generated items. The resource has its own template, in this template we only have some basic theming and a snippet. This snippet again takes the item id and generates the page. Now on that page we display a form, which is nicely in a chunk. But where in this whole process do we call FormIt? I tried it in the chunk, no luck. I basically tried it everywhere...
Basically i was hoping i could use the FormIt snippet in the chunk and drop the action element of the form.
What do you want to do with that form? To get FormIt processed it needs to be submitted I think...
It is getting submitted, as a regular form. The form itself does really nothing spectacular just sends a contact email.
I'm just not sure if formit can get the data because of the redirects and forwards. I tried running it as $modx->runSnippet() but couldn't get the form to grab the data that way either, so i was thinking that maybe a) formit does not work without its form having no action attribute (submitting to it's own page) or b) it can't handle / grab the data because of the redirects.
-
☆ A M B ☆
- 3,141 Posts
If you use $modx->sendForward() it wont trigger a redirect, so FormIt should be able to just work with that kind of workflow.. you might want to open up firebug/dev tools to make sure there's no htaccess or other unrelated redirect going on... Sure sounds more complex than it needs to be to me tho
-
☆ A M B ☆
- 24,524 Posts
If you need FormIt to process the submitted form, then pass data back to the SOAP source, you should be able to use the "store" property and the FormitRetriever snippet.
If you need to provide data to the FormIt before the form is displayed, you should be able to use a prehook to get the data, as long as the FormIt snippet is called after the data is available.
Thanks for all the input, even tough i like the formit principle and it's hooks etc. I went with modSwiftMailer.
-
☆ A M B ☆
- 24,524 Posts
Whatever works