3 tier navigation
Hi All,
I've been trying to get a multi level navigation working but am stumped. I want to display a 3 tier navigation, main_cat, sub_cat, sub_sub_cat.
I have an access database with the tables inc main_cat, sub_cat, sub_sub_cat. My results so far are poor. I've been able to display all data but my best result is the sub_sub_cats appear under the last sub_cat:
Main_cat (top horizontal menu)
Sub_cat1
Sub_cat2
Sub_sub_cat1
Sub_sub_cat2
I would like Sub_sub_cat1 to appear under Sub_cat1, not under all sub_cats, demo page here (its a charity website I'm working on)
http://www.tbdev.cfdeveloper.co.uk/
My code so far:
query:
<CFQUERY NAME="GetSub_Cat_home" DATASOURCE="dsn">
SELECT id,Sub_Cat,Sub_Sub_Cat FROM data where main_cat = 'home'
</CFQUERY>
<CFQUERY NAME="GetSub_sub_Cat_home" DATASOURCE="dsn">
SELECT id,Sub_Cat,Sub_Sub_Cat FROM data where main_cat = 'home' and Sub_Sub_Cat = '#Sub_Sub_Cat#'
</CFQUERY>>
output:
<cfoutput query="GetSub_Cat_home">
<li style="margin-left:10px"><a href="index.cfm?page=#page#&Sub_Sub_Cat=#Sub_Sub_Cat#">#sub_cat#</a></li>
</cfoutput>
<cfif Sub_Sub_Cat EQ ""><cfelse>
<cfoutput query="GetSub_sub_Cat_home">
<a href="index.cfm?page=#page#&id=#id#&Sub_Sub_Cat=#Sub_Sub_Cat#&intro=no" style="margin-left:20px">#Sub_Sub_Cat#</a>
</cfoutput>
</cfif>
</ul>
</div>
</cfif>
Appreciate any help as I really need to get this done soon and am well stuck
Cheers
Trevor
