Neal:

No problem.  But Sandy's gonna yell at me for using tables : )

In the Application.cfm, I create an array that holds the navigation
elements:
<cfif arrayIsEmpty(application.navArray)>  <!--- this array is declared
earlier in the Application.cfm --->
  <cflock scope="application" timeout="10" type="exclusive">
   <cfscript>
    temp = arrayResize(application.navArray, 5);

    application.navArray[1][1] = "home page";
    application.navArray[1][2] = "";

    application.navArray[2][1] = "about charlie";
    application.navArray[2][2] = "about/";

    application.navArray[3][1] = "resum&eacute;";
    application.navArray[3][2] = "resume/";

    application.navArray[4][1] = "code samples";
    application.navArray[4][2] = "code/";

    application.navArray[5][1] = "photos";
    application.navArray[5][2] = "photos/";
   </cfscript>
  </cflock>
</cfif>

The custom tag is called as:
<cfmodule
   template="_lib/inc/nav.cfm"
   page="home page"
>

where the 'page' attribute matches the 2nd dimension of the navArray.

for nav.cfm, I've put the code up at
http://charlie.griefer.com/_lib/inc/nav_code.cfm (figured it would be much
easier to read than in a word-wrapping email client).

let me know if you have any questions.

Charlie

----- Original Message -----
From: "Bailey, Neal" <[EMAIL PROTECTED]>
To: "CF-Community" <[EMAIL PROTECTED]>
Sent: Tuesday, April 06, 2004 1:11 PM
Subject: RE: Any CSS guru here?

> Charlie,
>
> Thanks for your help with this... you wouldn't happen to have a code
example
> of your navigation would ya. I really like the way it works. The way I
have
> it working now is that it passes a variable in the url but this seems kind
> of messy. Yours is cleaner and I could probably learn something from it.
>
> Thanks...
>
> Neal Bailey
> Internet Marketing Manager
> E-mail:  <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
>
>   _____
>
> From: Charlie Griefer [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 06, 2004 12:47 PM
> To: CF-Community
> Subject: Re: Any CSS guru here?
>
> Neal:
>
> check out http://charlie.griefer.com/.  The nav is nowhere near as fancy
as
> what you have, but I think the concept is the same as what you want.  If
you
> click on 'About', the 'About' stays highlighted.
>
> what I do there is put the navigation into a custom tag.  When I call it,
I
> pass the current page as a tag attribute.  Within the tag itself, I loop
> over an array (held in the application scope that holds structures
> containing the 'display name' and target of each navigation element), and
a
> conditional within each to determine whether or not the display name
matches
> the 'current page' attribute.  If match, no <a href> and set background
> color to 'active'.  Otherwise, include the href and the appropriate CSS
> (including the hover).
>
> Charlie
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to