We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4027
    • 1 Posts
    So I am looking in using MODx for my next website. Here is my question: I have a TON of custom php code I have already created and spent 100 of hours on. Can I easily move these scripts that write to a database and easily integrate them. For example, I have a job application script that writes to a database and has its own back-end. Thanks.
      • 3749
      • 24,544 Posts
      To move the code into MODx, it has to be put into snippets. How difficult that is depends on the number of php files and whether you’ve mixed php with HTML.

      You’ll also need to consider whether you want to move the data into the MODx DB and use MODx’s built-in methods to read and write it.

      Another possibility is to create a "bridge" between MODx and your existing application, leaving most of the existing app alone and styling the pages to look like the MODx site, or letting the existing app deliver the data to MODx for display. There are a lot of ways to go and which method is best for you depends on your app and your coding skills.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Backend stuff is usually pretty easy to bring in as a module. The MODx backend is based on frames; the right "workspace" frame is loaded up with whatever .php file is indicated by what’s being done. This is controlled in the /manager/index.php file. A module is simply php code that gets run and its output displayed in the "workspace" frame; this code can be as simple as a one-liner to include your own code. I’ve used this to load and run perl cgi scripts, so you can basically do anything with it that will output HTML to the frame.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org