We launched new forums in March 2019β€”join us there. In a hurry for help with your website? Get Help Now!
    • 16799
    • 3 Posts
    Hello,

    Sorry if this has been asked before, but is it possible to edit chunks/snippets with an actual editor?
      • 28042 β˜† A M B β˜†
      • 24,524 Posts
      Yes, there are two ways. One is to use a snippet that is nothing more than an include function to include a text file that contains your actual snippet/chunk code. Edit that text file as you please. Many ftp clients can be configured to open a file in a specified editor.

      The other is to use Firefox and install the "It’s All Text!" extension.

      https://addons.mozilla.org/en-US/firefox/addon/4125
        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
        • 16799
        • 3 Posts
        Wow, fast repsonse! Thanks!

        Including my code in the snippet sounds like just what the doctor ordered. Thanks a lot!
          • 16799
          • 3 Posts
          Another quick question:

          Is it possible to do the same thing with chunks? I would like to create a chunk file, which essentially acts as a template (has markup and placeholders). Im poking around the directory structure and see files with a .tpl extension, and the contents have markup + placeholders in them. Is this the same mechanics that I am wanting to do, or something else entirely?

          It appears that what i need to do would require me to load the tpl file in my snippet and replace the placeholders by hand, but im not entirely sure.
            • 22303 MODX Staff
            • 10,725 Posts
            You could do it only by using Snippets in place of your Chunks; but those could be pure HTML, PHP, or a mix. Chunks are just chunks and you cannot include things with it.