Hello,
Sorry if this has been asked before, but is it possible to edit chunks/snippets with an actual editor?
-
β 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
Wow, fast repsonse! Thanks!
Including my code in the snippet sounds like just what the doctor ordered. Thanks a lot!
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.
-
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.