I  use tags for my navigation.  These tags have nested tags that use
CFASSOCIATE to build a structure for navigation.  I completely hate to type
and can't stand having web designers
(or whatever the pc title for them is these days) in my code.  So I give
them a browser interface to add images with links and such to a table in the
databse.  You could also add a couple more tables and to catagorize the
navigation for subnav, but for this example I left it fairly simple.  This
also helps if you have some navigation that is global and some that is local
and individual navigation can be "shut off" without dealing with the HTML.

For example: (BTW I am completely aware that the query should be on its own
page and included in the local index.cfm, but give me a break this is a 5
minute response)

<---dsp_Nav.cfm--->
<cfquery name="all_nav" datasource="northwind" dbtype="ODBC">
SELECT      url_link, image, text, textcolor
FROM         dbo.NAVIGATION
WHERE ARCHIVE_BOL = 0
</cfquery>

<cfloop query="all_nav">
<cf_act_navbar>
  <cfoutput>
   <cfif text IS "">
    <CF_act_NavItem url="#urlencodedformat(url_link)#"
image="#trim(image)#">
   <cfelse>
    <CF_act_NavItem url="#urlencodedformat(url_link)#" text="#trim(text)#"
textcolor="#textcolor#">
   </cfif>
  </cfoutput>
</cf_act_navbar>
</cfloop>

<---act_navbar.cfm--->
<CFSWITCH EXPRESSION="#ThisTag.Executionmode#">

<CFCASE VALUE="start">
 <CFPARAM NAME="attributes.navtablewidth" DEFAULT="100%">
 <CFPARAM NAME="attributes.bgcolor" DEFAULT="FFFFFF">
 <CFPARAM NAME="attributes.textcolor" DEFAULT="000000">

 <!--- Navigation Table --->

 <CFOUTPUT>
  <TABLE WIDTH="#attributes.navtablewidth#" CELLSPACING="0" CELLPADDING="0"
BORDER="0" BGCOLOR="#attributes.bgcolor#">
 </CFOUTPUT>
  <TR>
</CFCASE>


<CFCASE VALUE="end">

<CFLOOP INDEX="i" FROM="1" TO="#arraylen(thistag.navattributes)#">
 <CFOUTPUT>
  <cfif thistag.navattributes[i].text IS "">
   <TD ALIGN="CENTER"><A HREF="#thistag.navattributes[i].url#"><img
src="#thistag.navattributes[i].image#"></A></TD>
  <cfelse>
   <TD ALIGN="CENTER"><A HREF="#thistag.navattributes[i].url#"><FONT
FACE="Arial"
COLOR="#thistag.navattributes[i].textcolor#"><STRONG>#thistag.navattributes[
i].text#</STRONG></FONT></A></TD>
  </cfif>
 </CFOUTPUT>
</CFLOOP>
</TR>
</TABLE>
</CFCASE>

</CFSWITCH>

<---act_NavItem.cfm--->
<CFASSOCIATE BASETAG="cf_act_navbar" DATACOLLECTION="navattributes">

<CFPARAM NAME="attributes.URL">
<CFPARAM NAME="attributes.text" default="">
<CFPARAM NAME="attributes.image" default="">
<CFPARAM NAME="attributes.textcolor" DEFAULT="ffffff">







------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to