We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17201
    • 3 Posts
    First of all, I LOVE MODx. I’ve looked at tons of CMS options and MODx has the features and the workflow that just makes sense. HOWEVER, there is one thing about MODx that just kills me and has been the only reason why I’ve continued to look for other options instead of just stopping and calling MODx my home.

    WHY are we forced to edit snippets, chunks, modules, plugins, and templates in the manager interface? This makes serious development a real pain in the arse. It didn’t bother me much in the beginning while I was just getting my feet wet but now that I’m working on some serious projects it’s slowed down the development process considerably.

    I heard some buzz about MODxfs (The ability to mount the MODx database as a file system and edit resources as if they were discreet files) and got really excited but the project seems to only work for a small niche and no one seems to be updating it.

    What I wish existed, was an alternate method for handling resources, where each snippet or chunk was a separate file (search.snippet, or sidebar.chunk). Each file could be stored in a sub-directory (snippets, chunks, templates, etc...). This would allow developers to work entirely in their editor of choice without having to work in both their editor for external files AND the manager for snippet code.

    This method also makes it easier to backup a site’s resources independently of the content.

    I’ve used plugins like EditArea that make the experience of edit code in the manager a little better, but I’m on a mac and the only browser that behaves correctly with EditArea is Opera.

    Does anyone else have any suggestions for this? I’m considering hacking the core to allow for a file-based architecture, but I figured I’d rant a bit first and see if anyone else has had similar feelings and worked out an elegant solution.
      • 22303 MODX Staff
      • 10,725 Posts
      First, I try to always do HTML/CSS/JS development first, then implement it in MODx as it makes the most sense.

      For server-side PHP, as I’ve discussed in many places in these forums, I always keep this code in separate includes on the file system, edit it with my personal favorite IDE (Eclipse with PHPEclipse), manage them in SVN, etc. There are similar techniques for including HTML templates, and probably no limit on other ways you can work that stuff in. It’s not perfect, but if you like to edit the files through an IDE, it can be much more comfortable.

      As for the future, built-in to 0.9.7, you will be able to maintain virtual resources that look like current MODx documents in your tree, but point at physical file resources on the filesystem to make this technique easier to manage and use.
        • 17282
        • 283 Posts
        Quote from: OpenGeek at Oct 15, 2007, 02:52 PM

        First, I try to always do HTML/CSS/JS development first, then implement it in MODx as it makes the most sense.

        For server-side PHP, as I’ve discussed in many places in these forums, I always keep this code in separate includes on the file system, edit it with my personal favorite IDE (Eclipse with PHPEclipse), manage them in SVN, etc. There are similar techniques for including HTML templates, and probably no limit on other ways you can work that stuff in. It’s not perfect, but if you like to edit the files through an IDE, it can be much more comfortable.

        As for the future, built-in to 0.9.7, you will be able to maintain virtual resources that look like current MODx documents in your tree, but point at physical file resources on the filesystem to make this technique easier to manage and use.

        I have no problem with Firefox on a mac?

        I think the snippet and resource editor is a good feature personally!

          Everytime you use Flash ... a puppy dies .....
          R.G Taylor
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Keeping the actual snippet source small, with the bulk of the code in an included external file, has the added advantage of keeping the site cache file smaller.
            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
            • 30884
            • 142 Posts
            I’m not overly fussed about the lack of a decent code editor and god knows I actually found the distinction between different elements in the backend manager helpful as I could have expected. I do tend to just use includes which are called from Modx snippets and edit them on file then move them into Modx once I’m happy with them. Little bit of in modx editing is un-avoidable but I can see the benefits of having files/virtual resources so we can use our fave php editors.

            Quote from: OpenGeek at Oct 15, 2007, 02:52 PM

            As for the future, built-in to 0.9.7, you will be able to maintain virtual resources that look like current MODx documents in your tree, but point at physical file resources on the filesystem to make this technique easier to manage and use.

            That would be soo good! I use PHP designer 2008 to write up (as you do) test code and so on, I’ve always wondered if i could get PHP Designer to read the ModX MySQL to act on the code in there.. 0.97 does sound like a much more feasible way to do it! grin
              p i x e l p u s h e r e x t r o d i n a i r e
              A x i s A n i m a t i o n . c o m
              • 12983
              • 108 Posts
              I came here to post the same question, lucky me someone other has already opened this thread.
              How feasible would be this my following suggestion?

              Imagine we have a filesystem tree with filenames and folders mapping the logical structure we’re used to manage via the web interface in the manager. Then, imagine we have a little app running in background (in our OS), which triggers its only action whenever we hit a keyboard shortcut (or a small button in some corner of the screen).
              The action is: "synchronize modx database with the filesystem tree".

              So, the development would be like:

              1) edit the files and save them (with text editor)

              2) hit a button (or keyboard shortcut) to synch the MODx database with the files’ contents

              3) test the site in browser


              Properly configuring this "little app" with database access informations, would it be possible to have?
              Someone able to do it here? Do you know some similar open source app which could be adapted for MODx symbiosis?

              Of course, the app should monitor which files (corresponding e.g. to db tables) have been edited since last synch, and commit only those changes: it has to be lightning fast wink
                • 25663 MODX Staff
                • 12,272 Posts
                insert_nick,

                You basically want subversion for database synching. I’m not aware of that being available.
                  Ryan Thrash, MODX Co-Founder
                  Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                  • 12983
                  • 108 Posts
                  Maybe, but I can’t imagine it as a subversion. In fact, basically I’d like an app with two buttons: "Map MODx db on filesystem" and "Go synch!", that works like summed up here:

                  1) with a config.ini file I can set db, username, password, charset, etc. to let the app send MySQL queries to a MODx db;

                  2) when I’m going to work with MODx for some web project, I first start the app; if I have still not, I press the "Map MODx db on filesystem" button and I let it work for a while: it generates what we call the "FILESx". Then, in a sqlite db or something similar, the app stores just the names/folders and creation timestamps of the FILESx: we call it the "PREx", and it will be used in step 5;

                  3) I work on the FILESx, adding/modifying/deleting chunks, TVs, snippets, etc. following some specific rules on the filenames and folders I can create;

                  4) I want to check my work in action into the web browser: so I press the "Go synch!" button and the app stores in the sqlite db the names/folders and creation/modification timestamps of the new FILEx: we call it the "POSTx", and it will be used in step 5;

                  5) the app makes some queries on the sqlite db to compare the PREx with the POSTx, and retrieves the list of files/dirs I have modified/edited/deleted;

                  6) according to whatever has changed, the app makes the appropriate MySQL queries to the MODx db, in order to synch it with the current FILEx; if this operation is completed successfully, the app replaces the PREx with the POSTx in the sqlite db;

                  7) I go to the browser window and refresh the page to see the effect of my changes on the FILEx, which have been reflected on the MODx db and normally (wonderfully) managed by MODx;

                  8) if I’m not satisfied, I work again on the FILESx;

                  9) (go to 4)


                  Btw:
                  As for the future, built-in to 0.9.7, you will be able to maintain virtual resources that look like current MODx documents in your tree, but point at physical file resources on the filesystem to make this technique easier to manage and use.

                  This makes the described app just a "quick hack" in comparison. The virtual resources on filesystem would be SO GREAT!
                    • 25663 MODX Staff
                    • 12,272 Posts
                    Ahh... what you want is 097 and xpdo reading from a flat-file database. Totally doable there of course. tongue

                    (Meaning 097 would be a lot better platform to do this on top of ...)
                      Ryan Thrash, MODX Co-Founder
                      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                      • 21257 MODX Staff
                      • 730 Posts
                      There is a beta (I’d say alpha actually) of a Linux program for mapping MODx database resources onto the filesystem.

                      http://modxcms.com/modxfs-1603.html


                      MODxFS lets Unix users with FUSE mount MODx databases as filesystems. This means you can directly edit Chunks, Pages, Snippets, and Templates with your preferred HTML/PHP editor.

                      The ITema (KiweeCommerce) guys produced this in the summer, and I actually did get it working. It was cool, but just a little flakey - I don’t use it anymore. Too bad it didn’t reach a more mature state before development stopped.
                        Mike Schell
                        Lead Developer, MODX Cloud
                        Email: [email protected]
                        GitHub: https://github.com/netProphET/
                        Twitter: @mkschell