First the warning.... I am still relatively new to CF. I've built a few semi
complex apps - an eStore, web based email, contact management and webzine -
but I'm no expert. Still very much learnin'.

If I understand this correctly you will have a table in the db that holds a
list of what pages are available. Using CF, you intend to generate a
drop-down list using the "available pages table". When the user selects an
item from the drop-down, the user will be directed to a page whose content
is built based on which item was selected from the drop down.

One of the gurus could probably help you better than I but, if it were me
this is what I'd probably do.

Let's use a webzine for example - your first page will have the drop-down
which will allow the user to choose for example a section (food, movies,
music, etc.) Once they've chosen that, they'll get a page with a list of
articles for that section, along with a short paragraph teaser for each
article. Clicking on an article link will display the full story. So, I
would set up the following tables:


"Available Content Table":
AvailContentCode <!--- your primary key. no duplicates --->
Description <!--- what is shown in the dropdown. i.e. food, music, etc --->
NavCode <!--- tells which navigation menu to use --->
BanneCode <!--- which banner to use --->
MainContentCode <!--- the content to use --->

"Main Content Table":
MainContentCode <!--- Primary key --->
AvailContentCode <!--- foreign key. duplicates allowed --->
ArticleHeading <!--- article heading displayed on your page --->
ArticleBody <!--- the full article --->

So, your pull down would look something like:
<cfquery name="avc">select * from AvilableContentTable order by Description

<form action="template.cfm" method="post">
<select name="getPage">
<cfoutput query="avc">
<option value="#AvailContentCode#">#Description#
</cfoutput>
</select>
</form>

On your template.cfm page....

<cfquery name="getContent"> select * from MainContentTable where
AvailContentCode = '#FORM.getPage#'</cfquery>

<cfoutput query="getContent">
<a href="showArticle.cfm?article=#MainContentCode#">#ArticleHeading#</a><br>
#Left(ArticleBody,100)#<!--- returns first 100 characters as a teaser --->
<p>
</cfoutput>

on showArticle.cfm page:

<cfquery name="getArticle">
select * from MainContentTable" where MainContentCode =
'#URL.article#'</cfquery>

<cfoutput query="getArticle">
#ArticleHeading#<br>
#ParagraphFormat(ArticleBody)#
</cfoutput>

If I spent more time thinking about this I could probably come up with
something cleaner, more efficient and logical. And the gurus on the list can
most likely run circles 'round my suggestions. But still, it's something to
get you thinking. That's provided I haven't misunderstood what you're
looking for.

Hope this helps.

Karl
P.S. If you have any questions about the above mess, feel free to ask 'em.






> From: "Web Designer" <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> Date: Wed, 6 Feb 2002 14:48:54 -0800
> To: <[EMAIL PROTECTED]>
> Subject: [CFTALKTor] Creating dynamic pages
> 
> Hi,
> 
> Does anyone know how to take build a drop down menu from an access database,
> using cold fusion  that links the items to a generic page where it will be
> built based on the fields from the database?  All the info in the page
> except for some graphics will be dynamic.  Does this make sense?
> 
> Would I use a template for this?
> 
> Thanks!
> Kelly
> 
> 
> 
> 
> 
> 
> 
> -
> You are subscribed to the CFUGToronto CFTALK ListSRV.
> This message has been posted by: "Web Designer" <[EMAIL PROTECTED]>
> To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
> Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
> This System has been donated by Infopreneur, Inc.
> (http://www.infopreneur.net)

-
You are subscribed to the CFUGToronto CFTALK ListSRV.
This message has been posted by: Karl Zarudny <[EMAIL PROTECTED]>
To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
This System has been donated by Infopreneur, Inc.
(http://www.infopreneur.net)

Reply via email to