I have a simple contact form already created on a straight html site that I am integrating into a modX site. Can I just integrate the php and everything that I have into the modx version of the site? Or must I utilize something like FormIt to process my form?
From my elementary understanding of modx, I know that php must be processed through a snippet, but the way the form works is that it is located in a html file, and the "action" for the form uses another php page to send the form. So would snippets even be necessary?
I apologize if this something I should already know the answer to, but it's something that I have not seen discussed before. Hopefully someone has a simple answer to this! Thanks!
-
☆ A M B ☆
- 1,780 Posts
The snippet would be where your php lives, replacing the php file you've got. Of course you can use your own php in a snippet if you want. That's part of the beauty of MODX.
However, it's rather easy to migrate an existing form into FormIt. Most of the fields are in the example, and you can always add more or delete them if needed. You'll have more options for forms, since they're built into FormIt.
Wrap your FormIt call with the form class/id that you use now, and it will look just like it. Make a chunk for your email template (how the contact email displays), and one for fetching the email from somewhere (a TV perhaps - named email_address - Desc. "enter email to use for contact form"),
Make another chunk with the full formIt call, tell it to fetch your email chunk, and to send it to the email address from a certain TV, or just enter the email address in. It's nice and organized with formIt, and you can use the form chunk over and over if you use the TV option for the email address to send to.
The examples in the documentation will help you a lot.
Thanks frogabog
I appreciate the advice. I'll be sure to post back with my results once I'm able to test this out.