Global Custom Tag Attributes

While working on my custom tag set, I discovered that I often have attributes that will be the same across a whole site. These attributes need to change from site to site.

For example, I have a "skin" attribute to skin the output of my custom tags. Every tag in a site should use the same skin. If I copy some code from one site to another, it should automatically use the skin of the site to which it is copied.

[More]

Related Blog Entries

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Steve:

Great idea. Just for confirmation, I've been doing the exact same thing for several years in a series of custom layout and form tags that we use also. I typically set the structure in the application.cfm file for an entire folder. As you said, it cuts down on the coding as well as making it easy to add/edit one of the attributes across the board since you only do it in one place.

Mark
# Posted By Mark Mazelin | 12/5/07 11:25 AM
Mark,

Thanks for the confirmation. It is encouraging that others are doing this as well.

I would hate to think it was one of those things that everyone but me knew to be a bad idea. ;-)
# Posted By Steve Bryant | 12/5/07 3:48 PM
I do the same in my form UDFs. Only rather than looking for external variables I place the defaults directly in the UDF definitions and allow them to be overridden.

Which as you can imagine means I have a copy of these UDFs for each site. There's good and bad points to having things set up this way, so far I've not had any problems and it works quite nicely.
# Posted By Adrian Lynch | 12/26/07 5:40 PM
Adrian,

That makes sense. I have built-in defaults as well, but allow them to be superceded by external variables. This allows me to copy the tags from site to site without changing them at all.

For a UDF, however, your approach may make more sense.
# Posted By Steve Bryant | 12/28/07 8:27 AM
BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.