We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3749
    • 24,544 Posts
    Interesting Idea. I never thought of doing that, but you could have everything as static on both the local and production site, use a good code editor to synchronize the files with FTP, and use ImportObjects and ExportObjects at both ends to manage changes. You could use Git locally to handle version control.

    The only down side is that MyComponent handles resources in the build and can export them, but I don't think it imports them at this point (though there's no reason why it couldn't).

      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
      I'll play with it some more.

      Here is something someone should try http://modx.com/extras/package/staticsaver

      Update
      This is absolutely awesomeeeeeeeeee
      Thanks to argnist for making this.

      Open your existing chunk or element, click static and save....voila...it creates a copy .php or .whatever on your file system.
      Edit that other hard file, and the changes appear in the chunk....sweeeeet! [ed. note: donshakespeare last edited this post 10 years, 2 months ago.]
        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.
        • 10357
        • 573 Posts
        That does look good - will it create a copy of the file when you create a new template, chunk etc.. in modx ? and how about when I create local chunk and then upload it?
        [ed. note: g5604 last edited this post 10 years, 2 months ago.]
          • 42562
          • 1,145 Posts
          Yes, it will create a copy when you create a new element.
          I think the settings are just lovely.
          It has one where you can set static as default... I wonder if I can fire that to copy existing elements without first opening each element form...hhmmm

          Rewrite file name on change element name
          staticsaver.enable_rewrite
          No
          
          If you change the name of the chunk, snippet, etc. will change the name of a static file. The old file is not deleted, it will be continue to be in the file system.
           
          Include category folder
          staticsaver.include_category
          No //If "Yes" file is placed to folder with the name of category.
           
          Static chunk files extension
          staticsaver.static_chunk_file_extension
          html //Set up an extension of chunk static files.
           
          Chunk Media Source
          staticsaver.static_chunk_media_source
          4 //ID of Chunk Media Source
           
          Static by default
          staticsaver.static_default
          Yes //If "Yes" sets all elements static in elements' forms
           
          Static files extension
          staticsaver.static_file_extension
          //Set up an extension of static files. Set empty to use different extensions for each type of elements
           
          Static plugin files extension
          staticsaver.static_plugin_file_extension
          php //Set up an extension of plugin static files.
           
          Plugin Media Source
          staticsaver.static_plugin_media_source
          4 //ID of Plugin Media Source
           
          Static snippet files extension
          staticsaver.static_snippet_file_extension
          php //Set up an extension of snippet static files.
           
          Snippet Media Source
          staticsaver.static_snippet_media_source
          4 //ID of Snippet Media Source
           
          Static template files extension
          staticsaver.static_template_file_extension
          html //Set up an extension of template static files.
           
          Template Media Source
          staticsaver.static_template_media_source
          4 //ID of Template Media Source
           
          Static TV files extension
          staticsaver.static_tv_file_extension
          html //Set up an extension of TV static files.
           
          TV Media Source
          staticsaver.static_tv_media_source
          4
            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.
            • 34926
            • 87 Posts
            Use Grunt. I don't use SASS but I use Grunt to watch and compile all CSS (LESS) and JS as well as generate an appcache, compress images and generate sprites. I use a media subdomain (not the assets dir) for all CSS, JS and images and have a context setting called '[[++media]]' that points to '//media.domain.tld/'.

            I have a 'main.less' file that imports everything it needs such as bootstrap and its variables. I imagine you can do the same in SASS.

            Edit: I just realised I was reading page 1 (not 3). Doh.