Design and Publishing Notebook

Using Textmate to Edit BC Pages and Templates

21 Mar 2010

Using a code editor to edit the content of pages, templates and layouts is simpler and quicker than using the Business Catalyst web interface.

To do this I’m using the Interarchy FTP client to view the website hierarchy. Recent additions to BC have provided access to templates and layouts as virtual folders in the site hierarchy. Previously these could be accessed only through the “Admin” menu and then clicking through a series of links. The new access method is much faster.

Interarchy (and no doubt other FTP clients also) gives you a contextual menu for any site item whereby you can edit the item in an external editor—in this case TextMate, my favourite coding editor. Behind the scenes Interarchy downloads the file via FTP into a temporary location and opens it in TextMate. Now you might think this series of steps would be time consuming. Surprisingly it usually happens in a fraction of a second.

Once you’ve finished editing the file in TextMate, saving it notifies Interarchy that the file should be re-copied back to the server. Once again, this happens remarkably quickly—in about a second or so. If you have Growl installed, then Interarchy will popup a brief notification that the file has been uploaded. Then you can test your changes by refreshing the page in a web browser.

As I said, this all happens so quickly that you would think you were editing a local file rather than a file on a remote server. It is much more straightforward than clicking around the online interface, scrolling to find the correct button, searching through multiple menus and submenus, and so on. You also work purely in HTML, whereas the browser interface defaults to non-HTML and you have to manually switch to HTML view each time you want to edit something.

The other big plus is that once your page content or template or layout is in an editor like TextMate, you get all the syntax highlighting goodness and powerful editing tools—such as grep, automatic indenting, code folding, and so on. In fact all the things you don’t get in a browser-based editing area.

This technique has made working with content in BC much easier and faster.

Recent Posts: