Hmm. I'm not quite sure what you're asking for...

But I think you might want this:

menu.cfm
<A HREF=showallitems.cfm?category=a>Category A</A>
<A HREF=showallitems.cfm?category=b>Category B</A>
<A HREF=showallitems.cfm?category=c>Category C</A>
<A HREF=showallitems.cfm?category=d>Category D</A>

When you go to showallitems.cfm, it builds this list:

showallitems.cfm:
<A HREF=showitem.cfm?item=a1>Item A1</A>
<A HREF=showitem.cfm?item=a2>Item A2</A>
<A HREF=showitem.cfm?item=a3>Item A3</A>
<A HREF=showitem.cfm?item=a4>Item A4</A>

These lists are built from queries (is THAT the bit you want to know about?)

So the list in menu.cfm above is built from a query that SELECTs all
categories.  You then use CFLOOP or CFOUTPUT to loop through the query
results and build the categories menu.

So the code for menu.cfm looks like this:
<CFQUERY NAME=Categories DATASOURCE=mydatabase>
        SELECT * FROM CategoriesTable
</CFQUERY>

<CFOUTPUT QUERY=Categories>
        <A HREF=showallitems.cfm?category=#CategoryID#>#CategoryName#</A>
</CFOUTPUT>


Then the code for showallitems.cfm look like this:
<CFQUERY NAME=Items DATASOURCE=mydatabase>
        SELECT * FROM ItemsTable
        WHERE CategoryID=#URL.category#
</CFQUERY>

<CFOUTPUT QUERY=Items>
        <A HREF=showitem.cfm?item=#ItemID#>#ItemName#</A>
</CFOUTPUT>

Then you have showitem.cfm, etc.

Is the answer in there somewhere? ;-)

Lee (Bjork) Borkman
http://bjork.net ColdFusion Tags by Bjork


-----Original Message-----
From: Michael Wilson [mailto:[EMAIL PROTECTED]]

I see where you are ging with this and this is what I intended to do for an
"item details page". What I need to do first is to display a single page
with all the items from a selected category in a list. Then the user can
select a particular item to get more information. I do have CFWAK 4.0 and
can't seem to find a refrence to doing exactly what I want. I did however
learn how to do the details page from Ben's book. As far a fuseBox is
concerned, I have looked into it and decided I needed to learn more CF
basics before I jumped on that. :)

How can I have a page where link "a" displays all items in category "a" and
so on for each category?



IMPORTANT NOTICE:
This e-mail and any attachment to it is intended only to be read or used by
the named addressee.  It is confidential and may contain legally privileged
information.  No confidentiality or privilege is waived or lost by any
mistaken transmission to you.  If you receive this e-mail in error, please
immediately delete it from your system and notify the sender.  You must not
disclose, copy or use any part of this e-mail if you are not the intended
recipient.  The RTA is not responsible for any unauthorised alterations to
this e-mail or attachment to it.  
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]
  • RE: BORKMAN Lee
    • RE: Michael Wilson

Reply via email to