As with all busy professionals it's sometimes hard to keep up with the
list(s), so if this has been done, let me know.

It's my preference to run all of a site's hyper links through the root index
file and not the fuse folder's index file. I know other's don't and that's
cool.

An example of one of my general folder structures:
Root Folder (Application Name)
Fuses Folder
Globals Folder
application.cfm
index.cfm

In the Fuses Folder:
Users Folder
Products Folder
Menu Folder

The problem I would encounter in the index file is keeping track of which
fuse a fuseaction belonged.
Example:
index.cfm?fa=add is that add a user or a product? So I instead I'd code
fa=addUser, which helped but it still wasn't always clear. Another way that
sort of helped was index.cfm?circuit=products&fa=add.

Now I'm testing another method I'd encourage feedback on:
Example: index.cfm?fusePath=products.add  (this is web safe for IE, I have
to test it on older browsers, a pipe might have to be use instead of a dot)
The first part is the name of the fuse and the second part is the
fuseAction.

The index file now reads:
<cfparam name="attributes.fusePath" default="">

<!--- extract the fuse FIRST --->
<cfswitch expression="#ListFirst(attributes.fusePath, '.')#">

    <cfcase value="products">

        <!--- extract the fuseaction --->
         <cfswitch expression="#ListLast(attributes.fusePath, '.')#">
                <cfcase value="add">
                        <cfinclude template="">
                </cfcase>
        </cfswitch>

    </cfcase>

</cfswitch>

Nested Fuses (or circuits) Helped:
If you wanted to do something like products.specials.add or
products.limitedtime.toys.add after you've implemented the products.add, no
problem. The ListFirst and the ListLast let's you add nested circuits/fuses
easily.  All you have to do now is nest the cfswitch and use ListGetAt to
exact the nested circuits/fuses name.

Last thought:
To avoid coding the fuse path for each link, set it in the app_local file
and then index.cfm?fusePath=#request.localFusePath#.add


Rick
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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