Know your Tools: Customizing Studio 1

 
Feb 14, 2000
 by Michael Dinowitz

One thing that I've learned is that to be good at something, you need more than just talent; You need good tools as well. Luckily for us all, Allaire has ColdFusion Studio to go hand in hand with the language. This editor cuts down on the time needed to write ColdFusion templates of any size, ranging from a single 'agent' to read through Ebay, to an entire stock site. The only problem with Studio is that it is so feature rich that many are lost on people. I'm going to highlight one such feature in this article and show how you can heavily customize Studio to make it "your" editing environment.

Most of us know the Tag Inspector that's located on the Resource Tab. This window shows us all the tags that are used within the current page. It also shows all the attributes for a specific tag that's been selected. One thing that few notice is that there's an option to edit the Tag Definitions.

This button, shaped like a little gear and located above the lower portion of the window, gives a programmer access to the definitions for any tag used in Studio. Here you can add new tags, edit the attributes of a tag, or even set some optional default values for an attribute.

In the figure above, we've added the values of #Application.DSN# and #DSN# to the optional defaults for the datasource attribute of the CFQUERY tag. When we press done, these values are then automatically added to the .vtm file for the CFQUERY tag. As you know, the .vtm file contains all the information for the tag, both for the Tag Wizard and for the Tag Insights. The optional defaults we added will not show up for the Tag Wizard . To make them show up there, we have to physically edit the .vtm file, which is something only a handful of people have actually done. On the other hand, these optional defaults WILL show up when we type the CFQUERY tag on the page. Once we type in the datasource attribute, the Tag Insights will offer us the option to select one of the values we set or it will allow us to type in anything else we may want.

After all this work, what are the results? One is a savings of dozens of keystrokes. This may not seem like much, but when typing all day, a few saved strokes can mean a lot. Additionally, you can now take the CFQUERY.vtm file, give it to all your developers, and now have a 'standard' of programming. This is exceptionally useful when you get a new programmer on your team and you want to get him up to speed fast.

A final thought came to me as I was finishing up this article. Most people don't scope their variables because they're just too lazy. It's true. Typing out a few extra characters is seen as a waste of time and/or effort. If you placed optional defaults into some of your tag attributes that contained all of the 'common' scopes, I expect people will start scoping a lot more. I plan to implement this tomorrow on my own machines.

As an aside, there's nothing wrong with being lazy. Every time-saving invention in the world was created by a lazy person. Lazy people put in a little effort once into building something so that they never have to do it again. This is an article on a lazy person's solution. :)


Privacy | FAQ | Site Map | About | Guidelines | Contact | Advertising | What is ColdFusion?
House of Fusion | ColdFusion Jobs | Blog of Fusion | AHP Hosting