We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 35176
    • 193 Posts
    hi ryan

    thank you for helping me understand. note, i’m not at all suggesting modx throw out the db, in fact i posted another thread suggesting to throw out the file-system. i’m just trying to understanding the benefits and drawbacks of each, and also trying to understand the motivations.

    it sounds like bringing modx features into the file-system might be more about satisfying coders who are more comfortable with that, or who want to use their favorite editor, rather than being true to the core philosophy of modx. personally, i support purity and integrity, i think it makes for a stronger, more solid product.

    i’m also not at all being critical of your design choices, i respect and admire modx and the work that has gone into it, and i am enjoying the fruits of your labors!

    my interest is because modx fulfills much of what i’ve been looking for in a cms. can’t wait for the next Revo release!
      jealousy<>love
      • 35176
      • 193 Posts
      Quote from: Adhiarta at May 05, 2011, 07:49 PM
      reduce the query in a database that becomes a problem on shared hosting (Mysql service is down). Alternative to storing static elements may be stored in the second database using SQLite

      turning modx into a file-based system because your sql service is down does not seem sound. MySql is standard, and if it’s down that’s not modx’s fault.

      i did not see SqlLite as an option when i did my install, is that coming?
        jealousy<>love
        • 35176
        • 193 Posts
        maybe, after their upcoming release is out of beta, code-editing could be on the developers’ road-map

        but clearly, they know what they are doing!
        ROCK ON MODX TEAM!
          jealousy<>love
          • 3749
          • 24,544 Posts
          Quote from: johnywhy at May 07, 2011, 09:29 AM

          maybe, after their upcoming release is out of beta, code-editing could be on the developers’ road-map

          but clearly, they know what they are doing!
          ROCK ON MODX TEAM!

          You might take a look at the CodeMirror package.
            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
            • 35176
            • 193 Posts
            i shall, but others here have implied that CodeMirror is a ’light’ or ’feature-reduced’ code editor.

            this is not so much for me, as for the posters above who say the reason they want file-based system is so they can use their favorite editor (ie not CodeMirror).
              jealousy<>love
              • 33997
              • 150 Posts
              As far as making templates into files, is there some simple snippet code or MODX code that could be dropped, kind of an import, that will pull the file? This will allow people to create templates in the DB, and the template will have only one line, such as a snippet with a parameter of the file location ( [[!GetTemplate? &source=`mytemplate.php`]] ) and that would allow people to keep their templates in the file system. In fact, if this is possible, it would be a quick and easy fix for anyone that would want to do this with chunks as well. Create a chunk with the same code.

              But be wary of file-based. If you have ever tried to do any templating in a program like XCart, you will have an idea of what I am saying. It is a large application, and so necessitates a LOT of files, and if you don’t know their folder structure (and even if you do) you may be searching for a while for the exact file. The dis-ease (wow, first wrote it out without the hyphen - funny how it became disease - difficulty is a better word) of use could be lack of planning and bad programmers. That being said, I could see that it would be nice to have templates as files, and some chunks (the chunks that I have bulks of HTML for templating in - not the smaller ones. But then how to keep track of which are in system and which are in files?).

              All things said, one of the best things about MODX is how it just works, and well. And one of the best features is that no matter where you are, no matter what computer you are on, you can pull up files and make changes to anything, because it is all online. If everything were file-based, or even partly file-based, it would be far more difficult to make quick edits while away (case-in-point: when I have to make CSS edits, I’m not a big fan of doing that within MODX, because I keep my CSS files as files).
                "Great spirits have always encountered violent opposition from mediocre minds." -Albert Einstein
                • 35176
                • 193 Posts
                I vote to put CSS into the db. That’s just a logical continuation of the system.

                Goonz, if files are online, why can’t you edit from any computer?

                I’m probably misunderstanding. I thought we are talking about an online db vs online files.
                  jealousy<>love
                  • 33997
                  • 150 Posts
                  Yes, online files. Sorry. But interfacing with the CMS itself, to me, is easier than using the file manager inside the CMS and editing each individual file, or downloading them, editing with a text editor, and then using the file browser to upload it again. CSS inside the DB makes sense as well, I’ve simply never done it yet. Was never sure what happens to the extension I set via friendly URLs (.html) and what happens when I make a page with the content-type of text/css. Does it append .css or .html? How does that work? Etc. Haven’t gone into figuring it all out yet (and haven’t asked when I should have...will do right now, come to think of it).

                  Asked here: http://modxcms.com/forums/index.php/topic,64270.msg363540.html
                    "Great spirits have always encountered violent opposition from mediocre minds." -Albert Einstein
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    Most FTP clients will interface with a number of editors. Cyberduck for the Mac even auto-edits image files in my preferred image editor. All I have to do is double-click the file and it gets opened in the appropriate editing app, and when I save it’s automatically uploaded. And Cyberduck uses the standard Mac Finder panes for local, so it’s just a matter of drag-and-drop from Finder to Cyberduck to upload (or vice versa). It makes using FTP easier than using the Manager.
                      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
                      • 1169
                      • 312 Posts
                      @goonz

                      There is a very simple snippet you can use to use files instead of the db
                      There are various examples in the forum.
                      Most people on the forum refer to it as the ’include snippet’
                      The one I use is actually called the ’include_Template’ I got it off the forum can’t remember where.
                      <?php
                      # Snippet to include template files from file system
                      # USAGE: [[includeTemplate? &tpl=`yourFileName.html`]]
                      
                      if ( !isset($tpl) || $tpl== "" ) return "Missing Template file!";
                      
                      $tpl = $base_path .'assets/templates/'.$tpl;
                      ob_start();
                      include($tpl);
                      return ob_get_clean();​


                      Save above code as a snippet with a Snippet Name of includeTemplate.
                      Call in the Template with:-
                      [[includeTemplate? &tpl=`yourFileName.html`]]

                      Note replace `yourFileName.html` with your chosen filename + extension.
                      These are backticks.
                      The reason I use the .html extension is my editor needs the extension for it’s goodies to work

                      I find this very useful when developing site.
                      I use 3 to 6 files as chunks and have all open in my editor.
                      In fact I call these files in my template which just consists of 3 to 6 includeTemplate calls.
                      When ready to transfer to live system just save file contents to chunks of same name no file Extension and change includeTemplate to chunk calls simple.
                      [[includeTemplate? &tpl=`head.html`]] becomes [[!$head]]


                      This is only my way not the correct or preferred way. grin
                      It works for me. wink

                        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