That is quite complex navigation you got there. Do your navigation links change so much? How about using a database to populate your navigation or XML based menus?

TK

----- Original Message -----
  From: Shannon Rhodes
  To: CF-Talk
  Sent: Thursday, October 23, 2003 5:27 PM
  Subject: Dynamic Nav and evaluate()

  I'm building dynamic site navigation and I'm concerned about processing
  speed.  I'm trying to break a bad habit by eliminating my use of evaluate(),
  but I just can't seem to figure out how to work around it.

  Here's what I have:
  *Variables are initialized in globals.cfm, called from application.cfm;
  among these are a series of two-dimensional arrays for each major section
  (primary nav) of the site.  These arrays contain the primary section's
  sub-navigation, i.e. the absolute link and the display label.  I also have a
  separate array which keeps track of which directories should be considered
  part of which section.  Another array defines the primary (left) nav
  links/labels.  The _javascript_ text is also created, for the rollovers.

  *In application.cfm, I figure out the directory I'm currently in, and then
  figure out which section that directory belongs to.  Then I set any
  variables specific to that section (for example, META tags).

  *I build the left-nav by looping through my primary nav array, checking each
  time to see if the current index is the section that I'm currently in (so I
  know whether or not to loop through the sub-nav).

  *The sub-nav is where I get stuck.  I have to use a dynamic variable to
  figure out which array to call based on the section I'm in ("Request.ARNav"
  & Request.SubNav).  Next thing you know, I'm using evaluate() like crazy:

      <CFLOOP INDEX="LinkDetail" FROM="1"
  TO="#ArrayLen(evaluate("Request.ARNav#Request.SubNav#"))#">
           <cfif cgi.script_name does not contain
  '#evaluate("#ThisSection#[LinkDetail][1]")#'>
           <a href="">   #evaluate("#ThisSection#[LinkDetail][2]")#</a>
         <cfelse>
          &##8594; #evaluate("#ThisSection#[LinkDetail][2]")#
         </cfif>
       </CFLOOP>

  It works, but it's ugly and I haven't tested download time yet (it's fine on
  my dsl but who knows on dial-up), but I'm really afraid that between this
  and all the image files for our new design, and all the various sections of
  my site that depend on dynamic content, I'm going to be looking at a slooow
  site.  I'm starting to think that maybe this is one of those cases where I
  should have stopped trying to code everything and just created a cfinclude
  nav file for each separate section of the site with the sub-nav hard-coded
  in, but then I wouldn't have the luxury of formatting my current page's nav
  option differently, which provides a nice visual rep of where you are.  Any
  thoughts/advice?  Sorry for the long post.  Thanks!


[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to