We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3873
    • 5 Posts
    I am having trouble understanding where all of the files reside. I understand the style of the site is in the assets (css, js, images) but what folder holds the HTML structure? I was going to sync the files from the server to have a local copy.

    Are the header, footer, and other element files stored in the database? Or are these external files referenced off the server that I can download/sync/edit/and reupload.

    Thank you for the help.
      • 26903
      • 1,336 Posts
      Your HTML structure is in the database, comprising of your templates and resources mainly, this is the default state, you can ’externalise’ these onto the file system if you wish.
        Use MODx, or the cat gets it!
        • 3873
        • 5 Posts
        Cool. Sounds like this is what I would like to do. Do you know how or where I could learn how to do this? Does anyone else work on template files locally?
        thank you
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          "externalizing" templates and such is a matter of using only a simple snippet in the Manager create/edit template field using file_get_contents() to load your actual HTML file for the template.
          [[GetTpl? &tpl=`myTpl`]]

          The snippet code would be something like this:
          <?php
          $template = file_get_contents("assets/templates/$tpl/$tpl.html");
          return $template;
          

            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