We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38543
    • 41 Posts
    I would like to edit the templat in a Code Editor, like Eclipse, for the code completion.

    Is it possible ? Where is the code of the template stored ?

    Thanks.

    This question has been answered by kayvon. See the first response.

      • 19369
      • 1,098 Posts
      They're stored in the database.
      • discuss.answer
        • 38898
        • 8 Posts
        If you're using at least version 2.2 you can store the template as a static file. Check the "is static" checkbox and you'll then have an option to specify an external file.
        • You can write a small snippet to "include" parts of a template.
          For example:
          [[include?file=`path/to/header.tpl`]]
          [[include?file=`path/to/body.tpl`]]
          [[include?file=`path/to/footer.tpl`]]


          include snippet can be like this:
          <?php
               $d = file_get_contents($file);
               echo $d;

          You can save those tpl part under your assets/template.

          Using snippet like this has a cons: you have to clear cache when you edit file. I'm not sure that using "is static" option will auto clear cache when you editing.
            • 38543
            • 41 Posts
            Hi, thanks for the suggestions.

            In case of static file, the content has to be only xhtml ? Or the file is used like non static ?

            Example : if I put some Modx code like , does it work ?
              • 38898
              • 8 Posts
              Yes, it will work.
                • 38543
                • 41 Posts
                ok thanks.