Keep an eye open for my site www.cfstarfield.com in a couple of weeks were I
will have all sort of detail on this...but here is my take on the problem.

Every circuit has the following directories:

actions
queries
displayers
actions
blocks
redirectors

(please note the variation from fusebox...I like the plural names for these
directories better...and I am quite anal about my directory structures too).
Each circuit may not need all these directories, but these are the basics.

Now of course, your index.cfm resides in the root of this particular circuit
and one would assume that you have some sort of navigation to traverse
circuits.  So in this (say this is the root) directory, I would also see a
directory called..

employees

which is a circuit in and of itself.  So, within my root index.cfm file, via
some click by the user on some navigation button or anchor, I will run a
piece of code in that root index.cfm which will basically jump control to
another circuit...so I might see in that index.cfm in the root directory...

<cfswitch expression="#attributes.fuseaction#">
        <cfcase value="employee">
                <cfinclude template="/redirectors/url_employees.cfm">
        </cfcase>
....

The trick to jumping circuits is to use redirectors.  The url_employees.cfm
file above would contains...

<cflocation url="/employees/index.cfm">

assuming you just want to go to the default display sequence at your first
point of entry...otherwise you could add ?fuseaction=blah to the redirector
(though in general a redirector really should just get you to the circuit,
not direct you to a point in that circuit...though there is no hard and fast
on this).

Once you are in your new circuit, you should find the same directory
structures, an index.cfm file and a series of redirectors to get you to and
from other circuits.

The only caveat here is directory mapping and pathing issues.  Any
navigation you use in a circuit under a circuit has to be relative.  Since
they cascade, if you have a piece of navigation that goes up and down a tree
of circuits you will have to make sure that as each navigation element is
rendered that it knows where to go.  For example, a link might take you up a
level to a higher
circuit's home page...it might read

<a href="../index.cfm">Go Back</a>

for example.  And is fine...or it could call to its own circuits control
index.cfm and use another url_ redirector to go back.  Either way, you have
to remember that if you are going to pick up this circuit and move it that
your links to move around from circuit to circuit may fail.  Just be
aware...and watch for that site I mentioned as it will go into this kind of
navigation in some detail.

Hope that helped to better understand circuit navigation.

Mike Craig

-----Original Message-----
From: Shane Johnson [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 08, 2001 8:51 PM
To: Fusebox
Subject: Nested circuits using Hal's techniques...almost


Hey people,
                I was trying to be very anal about my directory structures
using Hals method of nesting circuits.  Basically I wanted to have all my
circuit apps reside in a "circuits" directory off of the root of the "home"
app. so..

home_app/
           |
           circuits/
                  |
                  circuit+_app1/
                                 |
                                  actions/
                                 |
                                  queries/
                                 |
                                  display/
                                 |
                                  index.cfm
                                  myGlobals.cfm

crappy diagram but in english...

the home directory holds these directories:
circuits/
shared/
styles/
tags/

and these files:
index.cfm
myglobals
Circuits.cfm

the circuits directory holds the complete circuits apps but in a nice
orderly way so all my circuits are not jumbled together in my home directory
with all the global related stuff like shared,styles,tags, etc.

The problem is that I couldn't get the circuits.cfm to work correctly and
got nothing but 404 file not found errors.  The pathing information was not
translating properly so it couldn't find the circuits in the circuits
directory. Hopefully this makes sense the way I am describing it.



Shane Johnson
Web Production/Programming
Populuxe Digital Media
www.populuxe.com
[EMAIL PROTECTED]
(604) 714-2496
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to