We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6104
    • 26 Posts
    Sorry I am sure this has been asked before, but I wasn’t finding it when I searched.

    When you create:

    templates
    template variables
    chunks
    snippets

    Where are those stored? I prefer to edit those locally in my own text editor?

    Thanks
      • 25663 MODX Staff
      • 12,272 Posts
      They’re stored in the database. Copy/paste the contents to/from the textareas or use a Firefox plugin that makes the contents of textareas editable in your favorite browser for the most straightforward way to accomplish your goal.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 6104
        • 26 Posts
        Thanks for the prompt reply.

        I use gedit on linux and I will see if there is such a plugin though I have not heard of it, but is it possible to keep them from the database and in files or is that how the system works is only by storing them in the database?

        Thanks
          • 4971
          • 964 Posts
          The FF addon is "It’s all text"... it lets you use your favorite editor in all the textareas
          of the web.... so you just click and your editor opens, you make your changes, click the
          save icon and it updates the textarea.... save it and you are done!!!
            Website: www.mercologia.com
            MODX Revo Tutorials:  www.modxperience.com

            MODX Professional Partner
            • 4041
            • 788 Posts
            I picked this snippet up here in the forums and it works great for including files stored elsewhere (for example in your assets/folder).

            1. copy the code below and make a new snippet and name it IncludeFile
            2. call the snippet in a document or wherever you desire like this:

            [!IncludeFile? &file=`path/to/your/file/tobeincluded.php` &return=`1`!] (uncached)

            [[IncludeFile? &file=`path/to/your/file/tobeincluded.php` &return=`1`]] (cached)

            <?php
            /* IncludeFile.snippet.php
               last edit: 6/16/08  12:05 pm est
            
              &file=`assets/foo/bar.php` indicates the file to include
              &return=`1` return explicit content from return statement in included file
              default behavior is to use output buffering to capture the content from the include
            */
            
            $output = '';
            if (isset($file) && file_exists($file)) {
                if (!isset($return) || $return == false) {
                    ob_start();
                    include ($modx->config['base_path'] . $file);
                    $output = ob_get_contents();
                    ob_end_clean();
                } else {
                    $output = include ($modx->config['base_path'] . $file);
                }
            }
            return $output;
            ?>
              xforum
              http://frsbuilders.net (under construction) forum for evolution
              • 6104
              • 26 Posts
              Thanks everyone!