Melissa,

This is exactly what ColdFusion is designed to do.  You will have ten
separate ".cfm" files and each of the files represents one of your 10 pages.
Whatever information is 'static' for each page (in other words, whatever
information stays the same for every state) can be hardcoded into the .cfm
file.  Anything that is dynamic (can be different for each state) should be
referenced in the database.  

There are a number of ways to accomplish this (as just about anything in
ColdFusion can be done different ways) so you might get different ideas on
here from other people, but you can simply pass a 'url' parameter called
'state_id' or something like that that references a unique column in your
database and that represents the state.  Then you will have a <cfquery> tag
at the top of each of your .cfm pages that pulls the necessary 'dynamic'
information from your database for each state.

Finally, when you want to display dynamic information from the query,
surround your output with a <cfoutput> tag and your queryname and column
names with # signs like this:

Welcome to <cfoutput>#qMyQuery.state_name</cfoutput> 

Something like that.  

I recommend starting simple, with just creating your first page that
displays the dynamic 'welcome to' message and then you can build it up from
there.

Dave
-----Original Message-----
From: Melissa Cope [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 18, 2008 8:25 AM
To: CF-Talk
Subject: Creating a database with repeated information

Let's say you're making a MySQL database-driven website for states and each
state will originally be set up with the same ten pages worth of
information. (All states will have a home page saying "Welcome to our
state", all will have a contact page saying "Contact our state", etc.)

Obviously each state will want to personalize their pages through a
self-administration interface (being able to change their home page to
"Welcome to Rhode Island" and adding information about historic sites, for
example) so each state will have to have its own entries in the database for
each page. Which means you're looking at 500 entries to set up.

Is there a way to create the original ten entries, then somehow loop through
the next 49? I certainly hope so.

Thanks! 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:311175
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to