| By David Stutler | Article Rating: |
|
| April 18, 2006 04:15 PM EDT | Reads: |
20,221 |
Step 5: Build Your First Dynamic Page
Your first
dynamic page provides very basic functionality available in all
application server languages - the dynamic page include. The following
steps show you how to use the ColdFusion insert panel in Dreamweaver to
insert a ColdFusion CFINCLUDE tag into your page:
- In Dreamweaver, select File > Open and browse to index.cfm in the coldfusiondemo folder, where you placed all your sample files.
- Within Design view, scroll to the bottom of the page and locate the empty area beneath the main left column. Click in the empty area.
- On the Insert panel, click the pop-up menu and select CFML to show the CFML-related buttons on this panel (see Figure 3), which you'll need to incorporate standard ColdFusion functionality into your Web page.
- Click the cfinclude button (see Figure 4). When you select this option, the Tag Editor dialog box appears and asks for the path for the included file.
- Browse to footer.html inside your coldfusiondemo folder.
- Click OK.
Step 6: Build Your First Database Query in a Dynamic Page
Now to build database access into your dynamic page. Over the next
several steps, you'll use the Application panel in Dreamweaver to
create a recordset that selects records from a database and places
those records on the page:
- Open the Application panel in Dreamweaver if you haven't done so already. It displays a list of steps you must complete before you can do any dynamic development. Most likely, the first unchecked step is the RDS password step.
- Click the step to provide Dreamweaver with the RDS password to connect to your ColdFusion server. (You entered this password in Step 13 during the ColdFusion installation procedure earlier.)
- Click the Bindings tab in the Application panel. This is where you create your first recordset from the database.
- Click the plus (+) sign in the upper left corner of the panel and select Recordset (Query) from the pop-up menu.
- In the Recordset dialog box, name the recordset rsCoupons.
- For Datasource, select cfbookclub_pb.
- For Table, select BOOKCLUB.COUPONS.
- You want to sort the coupons by date, so in the Sort section select EXPIRATIONDATE and Descending in their respective pop-up menus.
- Click OK.
Follow these steps to output these fields on the page:
- Highlight the text "COUPON TEXT" on the right side of the index.cfm page in Design view.
- With that text highlighted, select the COUPON field from the list of fields in the Bindings tab in the Application panel.
- Click the Insert button at the bottom of the Bindings tab to insert the COUPON field onto your page. This places the dynamic field directly on the page.
- Highlight the text "Expiration Date" on the right side of the index.cfm page.
- Select the EXPIRATIONDATE field from the list of fields in the Bindings tab.
- Click Insert to add the dynamic field to the page.
- With that field still selected on the page, format the data by selecting the Format column pop-up menu in the Bindings panel.
- Format the field as a date using whichever mask you prefer (see Figure 5).
- Highlight the two new dynamic fields you just added to your page.
- From the Server Behaviors tab in the Application panel, click the plus (+) sign and add a Repeat Region to the page.
- A dialog box appears and asks you to specify how many records to display. Type 2 to show two records at a time.
- Click OK.
Time to test your page:
- Save all changes you have made to your page.
- Upload all your files from the Dreamweaver site to your Web server.
- View the following URL in your browser: http://localhost:8500/ColdFusionDemo/index.cfm
Congratulations! You've just created your first database-driven page using ColdFusion on a Mac.
Where to Go from Here
As you can see, developing
and testing ColdFusion applications on a Mac is easy. ColdFusion is a
robust application server; what you've accomplished is just the
beginning.
With a little digging around in the Application panel in Dreamweaver, you can explore all that is possible in a point-and-click environment until you become more comfortable with the ColdFusion language. The functionality ranges from user authentication to inserting and updating data in a database, all through a Web page that requires little-to-no hand coding. What a great way to learn a language!
If you are an existing Dreamweaver user, jump in and try ColdFusion and learn how easy it can be to create database-driven, dynamic Websites. Start out by visiting the Getting Started page (www.macromedia.com/devnet/coldfusion/getting_started.html) in the ColdFusion Developer Center, and then see where your creativity takes you.
Published April 18, 2006 Reads 20,221
Copyright © 2006 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By David Stutler
David Stutler is the owner and operator of WideEyed Media (www.wideeyedmedia.net), a new media development group located in Kansas City. In addition to his production duties, David serves as the lead Flash and Dreamweaver instructor for ThinqDigital, a Macromedia Authorized Training Partner. David is also an avid musician, spending the last 11 years in the vocal group measureXmeasure.
![]() |
Michael Long 04/26/06 07:02:34 PM EDT | |||
Just a rehash. I was hoping that the article would tell me how to get CF MX running on the latest generation of Intel Macs, but such was not to be. So note: If you have a new Intel-based Mini, iMac, or MacBook Pro, these instructions will NOT work. |
||||
![]() |
SYS-CON Italy News Desk 04/18/06 04:34:26 PM EDT | |||
It's not every day that you get the opportunity to pen an article about true love and technology. But in a few cases, true love and technology mix quite well. |
||||
![]() |
SYS-CON Brasil News Desk 04/18/06 12:15:09 PM EDT | |||
It's not every day that you get the opportunity to pen an article about true love and technology. But in a few cases, true love and technology mix quite well. |
||||
![]() |
SYS-CON Brasil News Desk 04/17/06 04:10:51 PM EDT | |||
It's not every day that you get the opportunity to pen an article about true love and technology. But in a few cases, true love and technology mix quite well. |
||||
![]() |
SYS-CON India News Desk 04/17/06 12:33:14 PM EDT | |||
It's not every day that you get the opportunity to pen an article about true love and technology. But in a few cases, true love and technology mix quite well. |
||||
![]() |
SYS-CON Australia News Desk 04/17/06 11:35:16 AM EDT | |||
It's not every day that you get the opportunity to pen an article about true love and technology. But in a few cases, true love and technology mix quite well. |
||||
- Adobe’s Aiming ColdFusion at Multiple Clouds
- Cloud Computing Journal: Adobe to Deliver ColdFusion in the Cloud
- Adobe May Cooperate with Apple to Transplant Flash Player to iPhone
- Adobe Flex Developer Earns $100K in New York City
- Adobe LiveCycle Enterprise Suite 2 for Cloud Computing
- Adobe Betas Target RIAs and Cloud Computing
- Adobe Cans Another 9% of its Workforce
- Moyea DVD4Web Converter V2.0 Converts DVD to FLV Fast and Synchronously with Watermarks
- Adobe & Salesforce Cut Cloud Deal
- Adobe Fiddles with its Web Apps
- Hosting.com Launches ColdFusion 9 in the Cloud
- The Real Time Infrastructure Ultimatum
- Adobe’s Aiming ColdFusion at Multiple Clouds
- Eval JavaScript in a Global Context
- Fig Leaf Software to Exhibit at Government IT Conference & Expo
- Cloud Computing Journal: Adobe to Deliver ColdFusion in the Cloud
- Is Microsoft as Free as Open Source?
- Adobe Reader Sued
- The Planet Named “Bronze Sponsor” of Cloud Computing Expo
- Microsoft Expression Web Has Got Game
- Adobe May Cooperate with Apple to Transplant Flash Player to iPhone
- Adobe Flex Developer Earns $100K in New York City
- Bruce Chizen Joins Voyager Capital as Venture Partner
- My Top Seven Wishes From Adobe MAX 2009
- The Next Programming Models, RIAs and Composite Applications
- Where Are RIA Technologies Headed in 2008?
- Constructing an Application with Flash Forms from the Ground Up
- AJAX World RIA Conference & Expo Kicks Off in New York City
- CFEclipse: The Developer's IDE, Eclipse For ColdFusion
- Personal Branding Checklist
- Adobe Flex 2: Advanced DataGrid
- Has the Technology Bounceback Begun?
- Building a Zip Code Proximity Search with ColdFusion
- i-Technology Viewpoint: We Need Not More Frameworks, But Better Programmers
- The Asynchronous CFML Gateway
- Web Services Using ColdFusion and Apache CXF






















