Thanks again Cameron!

<font face="courier new" size=-1>
<cfparam name="request.level" default="0">
<cfset request.level=request.level+1>

<!---
    Custom Tag : MyMakeTree.cfm     Author     : Steve Majewski
    Date       : 08/10/1999         Attributes:        
---->

<!---
Assign attributes passed to local variables.  Use the CFPARAM statements to set 
default values if attributes are not passed.
----> 
<CFPARAM name="ParentItemID" default="0">
<CFIF IsDefined("Attributes.ParentItemID")>
  <CFSET ParentItemID = Attributes.ParentItemID>
</CFIF>
<CFPARAM name="OrderBy" default="Category_Name">
<CFIF IsDefined("Attributes.OrderBy")>
  <CFSET OrderBy = Attributes.OrderBy >
</CFIF>
<!---
Query all items with ParentItemID equal to the current ParentItemID. All top level 
items should have a ParentItemID of zero (0).
----> 
<CFQUERY name="GetCurrentItems" datasource="s4s_seniorindex">
    SELECT * FROM Categories 
    WHERE Parent_ID = #ParentItemID#
    ORDER BY    #OrderBy#;
</CFQUERY>
<!---
Loop through the query and display the item information.
----> 
<cfparam name='indenttext' default='--'>
  <CFLOOP query="GetCurrentItems">
    <CFOUTPUT>
      <cfloop from=1 to="#request.level#" index=parent_id>&nbsp;&nbsp;</cfloop><cfif 
mode eq 3>* </cfif> #GetCurrentItems.Category_Name#<br>
  </CFOUTPUT>
<!---
Query items with ParentItemID equal to the current ItemID.      
---->
<CFQUERY name="CheckForChild" datasource="s4s_seniorindex">
    SELECT * FROM Categories
    WHERE   Parent_ID = #GetCurrentItems.CatID#;
</CFQUERY>
<!---
If CheckForChild returned records, then recurse sending the current ItemID as the 
ParentItemID.
---->
  <CFIF CheckForChild.RecordCount gt 0 >
    <CF_MYMAKETREE parentitemid="#GetCurrentItems.CatID#" orderby="#OrderBy#">
  </CFIF>
</CFLOOP>
<cfset request.level = request.level -1>
</font>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
------------------------------------------------------------------------------
To unsubscribe, send a message to [EMAIL PROTECTED] with 
'unsubscribe' in the body or visit the list page at www.houseoffusion.com

Reply via email to