We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25226
    • 29 Posts
    I really dig the way that MODx is put together, however I have not been able to figure out how to use an IDE like NetBeans or Zend Studio to develop and push code to MODx other than developing two versions. One in my IDE and then copy/past the code into Modx. and then also have to rename php code pages to snippets, html to chunks, and templates... In addition, everytime a change is made when debugging, I have to update in both environments. Seems like a version control disaster waiting to happen.

    Is there an easier and more efficient way to do this? Can the MODx framework and API library be downloaded into an IDE?

    also, does anyone have any input as to using MODx with a third party framework like Zend, PEAR, Yii, etc? Good or Bad???

    Thanks!

      • 3749
      • 24,544 Posts
      You can put something like this as the code of any snippet or plugin:

      return include "path/to/file.php";
        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
        • 25226
        • 29 Posts
        Yes, but it seems like it wasnt designed and optimized to be used that way. One of the perks of modx is how it makes use of snippets, chunks, etc. Referencing a file path just seems like a step backwords. Additionaly, if I did take advantage of snippets(vs file path) in modx is there a way to push new or updated code to MODx without using a Copy/Paste method?

        The only thing I can think of that would make modx better is a development environment that can actively communicate to a production environment....

        Since modx code is kept in a db, what about a script that Pulls and Updates snippets, chunks, templates, etc directly to the db? Would that work?
          • 3749
          • 24,544 Posts
          Most decent code editors have FTP built in.

          Check out the Provisioner extra. It provides the script you’re describing.
            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
            • 7327
            • 195 Posts
            I guess what robb’s saying is that if there’s anyway to work directly with code under saved templates, chunks, snippets, and plugins without having to rely on a slower web interface - this can greatly speed up development time. Something like SQLYog vs. PHPMyAdmin argument? I guess some of us, for organizational reasons, want to put code in the code content area rather than an external file reference?

            Cheers,
            Les

              • 3749
              • 24,544 Posts
              There’s no question that it would be great allow all resource and element content fields to be stored as files rather than in the DB. I think that we’ll have that at some point, but it’s not a trivial change because we’d need to retain the ability to retrieve them using xPDO queries.
                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
                • 16278
                • 928 Posts
                Less than integration, but much more convenient and safe than copy/paste, is to use Firefox and the It’s All Text! add-on. Then you can right-click in any textarea and work on its contents in your preferred editors (separate ones for HTML and PHP if required).
                laugh KP
                  • 34657
                  • 1 Posts
                  I’m evaluating various CMS’s so I can present alternatives to my employer (we do lots of Drupal work, bleck). I can’t recommend modx for this very reason.

                  Back-end code and front-end code need to be represented as static files so we can track changes using source control like subversion.

                  We all know that tracking database changes is a pain when dealing with a deploy process. Being able to push static files is safer and more reliable.



                    • 1169
                    • 312 Posts
                    I think this has been answered many times in the forum.

                    Here is how I go about it on localhost (wamp, lamp, mamp) (I am using Linux)

                    1 Load MODX into a new direcrory below your root dir
                    2 Create directories under assets for templates then ’templatename’ and subdirectories for other stuff eg.

                    assets
                    templates
                    ’templateName’
                    css
                    images
                    js
                    templates
                    chunks
                    snippets
                    ’anyOtherDirsRequired’

                    3 Make ’templateName’ a git repository
                    4 Create ’include snippet’ (there are various examples of this on forums just Google ’modx include snippet’
                    5 In the template, chunk, snippet, resource just call your ’include snippet’ with the file name in correct subdir of assets and you have a working dev environment with git for your version control.

                    You are then free to use any IDE or editor on these files

                    Welcome to MODX the freedom to choose how you develop.
                      DEVELOPMENT ENV:- Ubuntu 12.04 | MODx Revolution 2.2.8 | LAMP 2i Apache 2.2.22 | Php 5.3.10 | Mysql 5.5.31 MySQL client version: 5.5.31
                      • 4971
                      • 964 Posts
                      @allanb

                      How do you do #3? Make "templateName" a git repository?
                      TIA
                        Website: www.mercologia.com
                        MODX Revo Tutorials:  www.modxperience.com

                        MODX Professional Partner