One method I have found useful:

1) Store all navigation information in a database.
2) Create an array to contain all navigation items and store it in an
application variable.
3) Create a structure within each array item containing all display
information, such as user permissions, section display information, text or
the url of the graphic. Example: 

  application.navitems[i] = structnew();
  temp = structinsert(application.navitems[i], section_id, '1');
  temp = structinsert(application.navitems[i], image, 'home.jpg');
  temp = structinsert(application.navitems[i], user_level, '3');
  temp = structinsert(application.navitems[i], alt_text, 'Return to the Home
Page for this Section');

...etc.

4) Create the navigation bar as a separate circuit in your application. Call
it via CFMODULE within your display template. Otherwise just do an include.
Consider caching the nav bar where appropriate to conserve server resources.

This method is especially good if the navigation bar needs to be dynamic on
a per-user level, i.e. if you have a lot of security in your application and
want to include links only to the content the user has permission to see.
What I often do is create a client variable containing all of the user's
permissions (in this case, the section_id) and generate the navigation bar
by comparing the contents of the application and client variables.

One other thing I like to do is use autoimageeffects (a COM object) to
produce dynamic images for the navigation bar. I have the administration
section of my intranet set up to dynamically build the images for navigation
bars in anti-aliased postscript text whenever I add a new section to site.

Of course, I have found both of these techniques easier to do using CFCs...
more on that later.

M

-----Original Message-----
From: Dave Phipps [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 18, 2002 7:30 AM
To: [EMAIL PROTECTED]
Subject: RE: dynamic nav bar


Tim/Lee,

Do you have a code example of the array of structure nav idea?  Can you 
share?  It sounds interesting and something that I have not yet played with.

Cheers

Dave

At 03:22 6/18/2002 -0400, you wrote:
>Lee,
>     I would disagree.  I still use what you guys taught me earlier.  I 
> generate an array of a structure, with keys like url and imageName or 
> linkText.  Then loop over that to create a navigation area.  With the 
> added overhead of CFMODULE, vs. the speed with which CF handles arrays 
> and structures I cannot see why you would want to make recursive calls 
> like that.
>
>     The added benefit here is that it is very easy to have this generate 
> different menus down to the fuseaction level.  If you are setting up a 
> fuseaction for it, you are probably only going to be able to do it easily 
> down to the circuit.  Unless you are going to create a nav fuseaction for 
> each content/display fuseaction you have in that circuit, and then you 
> are doubling the number of cases you have and such.
>
>     I think this way has the most flexibility so far.
>
>     Tim
>-----Original Message-----
>From: BORKMAN Lee [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, June 18, 2002 12:20 AM
>To: '[EMAIL PROTECTED]'
>Subject: RE: dynamic nav bar
>
>Hi Tira,
>
>I would create a separate "navbar" fuseaction (possibly in its own 
>circuit).  The "navbar" fuseaction would query the database and display a 
>menu based on that data.
>
>Then, in the site's main layout, I would use <cfmodule> to invoke the
navbar.
>
>If you want the navbar to be context-sensitive, then you'll probably want 
>to pass in an additional attribute in your cfmodule call, possibly 
>context="fusebox.targetcircuit" or similar.
>
>As ever, with these recursive <cfmodule> calls, watch out for infinite 
>loops in your layouts.
>
>Hopw that helps,
>LeeBB
>-----Original Message-----
>From: Tira Cole [mailto:[EMAIL PROTECTED]]
>sorry.... populated from a database
>
>  -----Original Message-----
>From: Drew Harris [mailto:[EMAIL PROTECTED]]
>What do you mean dynamic?
>Based on security permissions or what?
>-Drew Harris
>
>On 6/17/02 7:14 PM, "Tira Cole" <[EMAIL PROTECTED]> wrote:
>
>Could anyone offer any suggestions on incorporating a dynamic navigation 
>bar into a fusebox site? I am very new to fusebox so any suggestions, tips 
>etc will be most appreciated.
>Thanks in advance
>Tira
>
>
>IMPORTANT NOTICE:
>
>This e-mail and any attachment to it is intended only to be read or used 
>by the named addressee. It is confidential and may contain legally 
>privileged information. No confidentiality or privilege is waived or lost 
>by any mistaken transmission to you. If you receive this e-mail in error, 
>please immediately delete it from your system and notify the sender. You 
>must not disclose, copy or use any part of this e-mail if you are not the 
>intended recipient. The RTA is not responsible for any unauthorised 
>alterations to this e-mail or attachment to it.
>
>


============================================
Phipps CF Development
Oxford, Oxfordshire.
Telephone: +44(0)7718 896696
http://www.phipps-cf.co.uk
============================================

==^================================================================
This email was sent to: [email protected]

EASY UNSUBSCRIBE click here: http://topica.com/u/?bUrFMa.bV0Kx9
Or send an email to: [EMAIL PROTECTED]

T O P I C A -- Register now to manage your mail!
http://www.topica.com/partner/tag02/register
==^================================================================

Reply via email to