Home arrow ColdFusion arrow Introduction to ColdFusion Markup Language
COLDFUSION

Introduction to ColdFusion Markup Language


If you want to get a good start on learning ColdFusion, look no further. This article covers a whole bunch of CFML tags and some basic functions. It is the first of two parts, and excerpted from chapter three of the book ColdFusion Web Development with Dreamweaver MX 2004, written by Jen and Peter deHaan et al. (Apress; ISBN: 1590592379).

Author Info:
By: Apress Publishing
Rating: 5 stars5 stars5 stars5 stars5 stars / 50
January 19, 2006
TABLE OF CONTENTS:
  1. · Introduction to ColdFusion Markup Language
  2. · Tags Used in CFML
  3. · The Application.cfm File
  4. · Understanding Common ColdFusion Tags
  5. · The cfif tag
  6. · The cfswitch tag
  7. · The cflocation tag

print this article
SEARCH DEVARTICLES

Introduction to ColdFusion Markup Language
(Page 1 of 7 )

COLDFUSION MARKUP LANGUAGE (CFML) is ColdFusions own set of tags that makes up the bulk of the dynamic functionality found on ColdFusion pages. CFML has two different parts that make ColdFusion work: tags and functions. In this chapter we cover a whole bunch of CFML tags and also some basic functions. Chapter 4 shows you how to use some of the more advanced functions and teaches you about variable scopes and different data types.

Tags are used to carry out operations, such as looping over Recordsets, uploading files to a web server by way of a web form, dumping the contents of a variable to the screen for debugging, and grabbing the contents of a remote page on the Web. Functions within ColdFusion are used to manipulate data or perform calculations. For example, ColdFusion has a function called #ArrayAvg()#, which calculates the average of the numeric values within an array. You often must use tags and functions together to build a completely functional site.

Introducing CFML

HTML and ColdFusion tags can exist together within a document that is requested from a web server. All ColdFusion tags start with <cf. The ColdFusion server will process anything within these tags, ignoring any plain HTML tags. The server will return any HTML generated by processing your ColdFusion tags, and then the entire page is returned to the user's browser. Other things to note about CFML include:

  • Whenever using ColdFusion tags within a document, you must save it as a.cfmfile for it to be recognized and interpreted by the ColdFusion server.
  • In text strings, all text is considered literal unless it is within a set of pound/hash (#) signs.
  • ColdFusion elements (the opening and closing tags, and everything in between) are called blocks. For example, if you were using a<cfif>element in your code, it would be called the<cfif>block.
  • To add comments inside ColdFusion tags, you must use CFML comment delimiters:<!--- CFML comment --->. Notice that these are similar to HTML comments, but have three dashes instead of two. If you use HTML comments inside your CFML, they will not be ignored by the ColdFusion server as expected, and you will either get errors or will dynamically create HTML comments. Also, CFML comments will not send text back to the users browser like HTML comments do.

Now we provide a general overview of the many categories of tags, and the most common ones you will be likely to use in your work. We then go through some of these tags in detail, along with the functions that help these tags work and make your applications run.

TIP   You can also extend ColdFusion by writing your own custom tags using CFML, or even Java or C++. Writing custom tags is covered in more detail in Chapter 10. Custom tags written in ColdFusion are prepended with CF_, whereas any custom tags written in Java or C++ are prepended by CFX_.


blog comments powered by Disqus
COLDFUSION ARTICLES

- Adobe ColdFusion Just Got More RAD
- How to Access a SQL Anywhere Database with C...
- CFXML: Probing XMLDOM in ColdFusion
- Creating a Web Service with ColdFusion: the ...
- CFAjax: What it is and How to Use it
- Querying SQL 2000 Server from ColdFusion
- Introduction to ColdFusion Markup Language, ...
- Introduction to ColdFusion Markup Language
- Databases and Dreamweaver MX 2004, concluded
- Databases and Dreamweaver MX 2004
- Welcome to Coldfusion MX 6.1, concluded
- Welcome to Coldfusion MX 6.1
- What You Must Know About ColdFusion Flow-Con...
- What You Must Know About Operators in ColdFu...
- Everything You Must Know About ColdFusion Va...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials