We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9142
    • 2 Posts
    Hi Group--

    I’ve been asked to integrate an existing "stand alone" php application into
    a friend’s MODx site. Will I have to re-implement this application to run
    within the MODx framework (e.g. modules), or is there a way to use the
    current code "as is"?

    Thanks!
      • 33372
      • 1,611 Posts
      It depends on the application, but as a rule you should be able to include the existing code "as is". Modules are basically just includes in the manager context, so that’s not a difficult bridge to cross. Just keep in mind that if you include PHP code from a snippet or plugin that you’re not executing it globally, so you might need to make some changes to correct for that (oh and if your existing PHP application relies on register_globals being set to on you should recode it not to do that).
        "Things are not what they appear to be; nor are they otherwise." - Buddha

        "Well, gee, Buddha - that wasn't very helpful..." - ZAP

        Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
        • 9142
        • 2 Posts
        Thanks! Is there any documentation or online example that shows an example using an "external" web application within the MODx framework? That is, having the content provided by the application displayed as a MODx "page".

        For example, web applications tend to provide the header information for cookies, etc and html head blocks to load javascript files, but the content of a MODx page is provided in the context of the MODx environment.

        Thanks.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          If that is the case, you can always load it into a document that has no template. Use its own css (or however it styles itself) to style it to look like your site.
            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