We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21913
    • 10 Posts
    I was wondering if anyone can point me toward a sensible way of developing snippets? I’ve never been a great fan of html text areas for developing code smiley. It seems to me that it would make sense to develop outside of modx using a decent IDE and debugger and once the code’s finished migrate it to modx. But to make this approach worthwhile I’d need to have some means of accessing the modx API’s while I’m doing the initial development. I can’t believe I’m the only one to have problems with this, so I’d appreciate any tips & tricks on snippet development methodology.

    Thanks,
    numptie
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      I use Firefox, and have the "It’s All Text" extension. That lets you edit the textarea in the editor of your choice.

      Or you can have your snippet code consist of one line to include() or require() an external file, and edit the external file as you please. This has the additional advantage of minimizing the snippet’s footprint in the siteCache.idx.php cache file.
        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
        • 21913
        • 10 Posts
        Thanks a lot for pointing me toward the "It’s All Text" extension. What a neat tool. As for just having the include() or require() in the snippet. Well, frankly, that’s embarrassing. Sometimes the obvious solutions are only obvious once someone else is kind enough to point them out smiley.
        Again, many thanks for your help.