We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40122
    • 330 Posts
    Currently when making a MODX site I code straight through the Manager using a text-highlighter like Ace.

    I want to be able to code from my PC using Sublime, run some tasks with Gulp on save and upload the file directly to the remote server. Is there currently a way to do this?

    I guess I could create Templates with Snippets that have something like:
    <?php include('template.php') ?>


    But that feels a little clumsy to me.

    Any other way to do this?

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

    • discuss.answer
      • 42562
      • 1,145 Posts
      Is this not what Static Elements are for?
        TinymceWrapper: Complete back/frontend content solution.
        Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
        5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
        • 40122
        • 330 Posts
        Quote from: donshakespeare at Aug 31, 2016, 07:57 PM
        Is this not what Static Elements are for?

        I gotta admit I always thought this was for straight .html files.

        Can this work with .php templates using MODX placeholders?
          • 42562
          • 1,145 Posts
          donshakespeare Reply #4, 10 years ago
          PHP goes into plugins and snippets.
          HTML and client-side stuff go into Templates and Chunks.

          Whatever that is permissible in an element is also permissible in its static form.

          If Template can hold MODX snippet tags and placeholders, so can a its static form.

          I am not sure I understand .php templates ... but I hope this helps smiley
            TinymceWrapper: Complete back/frontend content solution.
            Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
            5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
            • 3749
            • 24,544 Posts
            Plugins, Snippets, Chunks, and Templates, can all be marked as static. That creates a file containing their content that you could deploy to the remote.

            Note that MODX doesn't actually use the file. It still uses the version in the DB. The file is just a copy of that. You can update either way: 1) edit in the Manager and save the file. 2) Edit the file and reload the page in the Manager.

            Be careful, though. If you delete or empty the file and reload the element in the Manager, your content is lost for good.
              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
              • 42562
              • 1,145 Posts
              donshakespeare Reply #6, 10 years ago
              Be careful, though. If you delete or empty the file and reload the element in the Manager, your content is lost for good
              MODX Static Electricity! that shock is not a friendly one: "where's ma content???"
                TinymceWrapper: Complete back/frontend content solution.
                Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
                • 3749
                • 24,544 Posts
                LOL. wink
                  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