Hi, Still in categories and subcategories: my below component
is displaying the code as tree menu:
<cfcomponent name="Categories">
<cffunction name="getCats">
<!--- Parent ID --->
<cfargument name="parent" type="numeric">
<!--- Query for Children of Parent --->
<cfquery name="cats" datasource="#request.dsn#">
SELECT * FROM
categories
WHERE parentid = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#arguments.parent#">
</cfquery>
<!--- Create Output --->
<cfif cats.recordcount GT 0>
<cfset output = "<ul>">
<!--- Loop over all items --->
<cfloop query="cats">
<cfset output = "#output# <li><a
href='a.cfm?id=#cats.catID#'>#cats.category#</a>">
<!--- Check Children of this item --->
<cfif cats.recordcount GT 0>
<cfset output = "#output# #CreateObject('component',
'wrap').getCats(cats.catid)#">
</cfif>
<cfset output = "#output#</li>">
</cfloop>
<cfset output = "#output#</ul>">
<cfreturn output />
</cfif>
</cffunction>
</cfcomponent>
And what i was tryng is that for every category a <td>
should be created and then i should add something like <cfif
query.currentRow MOD 3>
it should move to the next <td> TAG.
Till Here but the problem is i am trying to doin may be say
stupid way.
under category in one <TD> if that category have
subcats. then it should display them as ul and li. and like this:
i created a table generation but getting into problems while
plugging it in the cfc:
here is of my auto table generation:
<table align="center" width="100%" border="0">
<cfif variables.newrow EQ true>
<tr>
</cfif>
<td>My CFC Code Goes Here</td>
<cfif query.currentRow MOD 4 EQ 0>
</tr>
<cfset variables.newrow = true>
<cfelse>
<cfset variables.newrow = false>
</cfif>
<tr>
</table>
</div>
</cfoutput>