Understanding Data-Driven Templates

Now compare Figure 10.1 to Figure 10.2. Can you see the difference between them? Look carefully.

Give up? The truth is that there is no difference at all (well, other than the file extension in the URL, that is). The screen shots are identical, and if you looked at the HTML source that generated Figure 10.2, you’d see that aside from a lot of extra white space, the dynamically generated code is exactly the same as the static code you entered in Listing 10.1 and nothing like the (much shorter) dynamic code you entered in Listing 10.2.

How did the code in Listing 10.2 become the HTML source code that generated Figure 10.1? Let’s review the code listing carefully.

The <cfquery> Tag

Listing 10.2 starts off with ...

Get Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.