Topic: point of no return - integrating an existing website into MODx  (Read 198 times)

Pages: [1]   Go Down

#1: 14-Nov-2009, 01:58 AM

thissideup
Posts: 13

WWW
Hello,

I recently installed Evolution 1.0.2.

I have a website that is ready to be launched. I decided to try integrating the website into MODx. The website includes XHTML, CSS, JavaScript, and PHP. Once launched, I am implementing a second phase of the project: providing the client with content management functionality; hence my desire to use MODx.

I have spent a few hours learning how to create templates and resources, and the static portion of the website is done.

I am now in the process of integrating the PHP code, specifically for a contact form. This is where my first general question arises - is it necessary to re-do all of the PHP code as snippets, or is there a way to re-use the PHP from the website as-is? I believe this is complicated by the fact I use session variables to remember values entered by the user, so a reload of the contact form doesn't wipe out their data. In other words, the best way to access session variables is to ensure all PHP code is run in snippets, correct?

If everything should be converted to snippets, how should the validation code (the code run when the form data is posted) be re-worked? Is the format suggested by Breezer in this thread http://modxcms.com/forums/index.php?topic=27000.0 the way to go?

I seem to be at a point of no return: either keep spending time re-writing the website for MODx, or abandon this approach and write my own content management for the client. It is involving more of a re-write to integrate this website than I first thought it would be, and am wondering if I am doing something wrong.

Thanks,
Ben

#2: 14-Nov-2009, 02:28 AM


bunk58
Posts: 1,800

David Bunker

WWW
Converting custom PHP forms isn't usually too bad.
You should probably only need one snippet.
The PHP goes in the snippet, you can put the HTML into a chunk, or as Breezer showed mix the two in the snippet if that's easier.
I'd think it would be a lot less work than
Quote
write my own content management for the client

#3: 14-Nov-2009, 03:07 AM

Coding Team

BobRay
Posts: 5,348

WWW
If you just need a simple contact form, you might look at the SPForm snippet. Otherwise, yes, the php code has to go in a snippet or snippets.

The eForm snippet is another alternative if you need a more complicated contact form.
MODx info for newbies: http://bobsguides.com/MODx.html
Pages: [1]   Go Up
0 Members and 1 Guest are viewing this topic.