magazine resources subscribe about advertising

New Architect Daily
Commentary and updates on current events and technologies

CMP Media E-Book

Download your copy today.

Research
Search for reports and white papers from industry vendors and analysts.

This Week at NewArchitect.com Subscribe now to our free email newsletter and get notified when the site is updated with new articles







Day of Defeat Online Gaming

 New Architect > Archives > 1998 > 03 > Features  

Creating Your Own Tags With Cold Fusion

Extending HTML with CFML

By Leon Chalnick

It's difficult to write reusable code in the tag-based world of HTML. However, Cold Fusion enables you to create your own custom tags, which can have their own attributes and return values to the calling template.

Cold Fusion is a 32-bit, multiprocessing application server that runs in the Windows NT and UNIX environments alongside your Web server. Because it works with a wide variety of Internet standards (HTTP, SMTP, LDAP, and so on), Cold Fusion makes it easy to integrate databases into Web sites and intranet applications.

Custom Cold Fusion tags can be developed either in Cold Fusion Markup Language (CFML) or in C++, by including Cold Fusion API (CFAPI) components in your program. In addition to enhancing speed, CFAPI tags can call third-party DLLs and perform other advanced functions.

This article, however, focuses on CFML-based tags, which don't require C++ programming knowledge and can be passed parameters (that is, have their own attributes) and return values in the calling CFML template. In your custom tag code, you use the Attributes variable scope to address your tag's attributes, and the Caller variable scope to create variables in the calling template. The advantage of custom tags over older code-reuse methods (like <CFINCLUDE> tags) is that variables defined in the custom tag and Attributes variables are scoped to the custom tag. CFML tags can be scoped to an individual application (by including the tag in that application's directory tree) or to the entire server (by including the template in the CFusion/CustomTags directory).




  Day of Defeat Online Gaming

home | daily | current issue | archives | features | critical decisions | case studies | expert opinion | reviews | access | industry events | newsletter | research | careers | info centers | advertising | subscribe | subscriber service | editorial calendar | press | contacts


Copyright © 2006 CMP Media, LLC Read our privacy policy, your California privacy rights, terms of service.
SDMG Web sites: BYTE.com, C/C++ Users Journal, Developer Pipeline, Dr. Dobb's Journal, DotNetJunkies, MSDN Magazine, Sys Admin,
SD Expo, SD Magazine, SqlJunkies, The Perl Journal, Unixreview, Windows Developer Network, New Architect

web2