I recently cam up with a structure for nested menus. it has worked well so far but I have not gone more then one level with this site.  I have used "Lee's" (thought I used it before I knew Lee was too) menu layout before but found it a but confusing to keep up with...I would like to design a menu "app"...may be in the future.

in the root circuit I have a file:
<cfscript>
menu = structNew();
//code
menu.b = "main|code";
menu.c = "main|community";
/*
menu.c = "main|community";
menu.d = "main|about";
menu.e = "main|security";
*/
</cfscript>
<cfoutput>
<table width="50" border="0" cellspacing="0" cellpadding="0">
        <cfloop collection="#menu#" item="itm">
        <tr><td nowrap class="tdwhite"><a href=""#self#?spime=#gettoken(menu[itm],2,"|")#.#gettoken(menu[itm],1,"|")#">#gettoken(menu[itm],2,"|")#</a></td></tr>                 <cfif gettoken(menu[itm],2,"|") eq fusebox.circuit and isdefined("submenu")>
                        <cfloop collection="#submenu#" item="itm2">
                                <tr><td nowrap class="tdwhite">&nbsp;&nbsp;&nbsp;<a href=""#self#?spime=#trim(gettoken(menu[itm],2,"|"))#.#gettoken(submenu[itm2],1,"|")#">#trim(gettoken(submenu[itm2],2,"|"))#</a></td></tr>                         </cfloop>
                </cfif>
        </cfloop>
</table>
</cfoutput>


in the child circuits include a layout file
<cfinclude template="qry_code_cat.cfm">
<cfscript>
submenu = structNew();
//code
count = 0;
while (count lt qry_code_cat.recordcount) {
count = count + 1;
SetVariable(("submenu.a" & count) , ("list&type=" & qry_code_cat.codeCatID[count] & "|" & qry_code_cat.CatName[count]));
}
submenu.b = "|";
submenu.c = "addcode|Add Sample";

</cfscript>
        <cfoutput>
                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tbwhite">
                        <tr>
                                <td colspan="2" class="tdwhite">&nbsp;</td>
                        </tr>
                        <tr>
                                <td width="10" class="tdwhite">&nbsp;</td>
                                <td valign="top" class="tdwhite">
                                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                <tr>
                                                        <td colspan="3" class="tdwhite"><a href=""#self#">home</a>" > #lcase(fusebox.thiscircuit)#</td>
                                                </tr>
                                                <tr>
                                                        <td height="5" colspan="3" class="tdwhite"><img src=""../images/shim.gif"" width="1" height="5" alt="" border="0"></td>
                                                </tr>
                                                <tr>
                                                        <td width="50" valign="top" nowrap class="tdwhite">
                                                            <cfinclude template="#fusebox.rootpath#act_menutest.cfm">
                                                        </td>
                                                        <td width="10" class="tdwhite">&nbsp;</td>
                                                        <td valign="top" class="tdwhite">#fusebox.LAYOUT#</td>
                                                </tr>
                                        </table>
                                </td>
                                <td width="10" class="tdwhite">&nbsp;</td>
                        </tr>
                </table>
        </cfoutput>


At 11:38 PM 4/22/2002 +1000, you wrote:

Hey Tim,

You have hit the nail on the head, when you talk about the slowing the site down any more than the cable company already is ;-)  Yes, cfmodule calls do come with a small performance hit (a few milliseconds), but unless you are doing deeply recursive crunching, it's not going to be significant compared to network speed.

Really, now that FB3 has come along and made recursion both efficient and robust, it looks like this much-trumpeted Fusebox feature is really coming into its own.  We have Hals' MVC implementation, Patrick's CF_call tag, my Pjortal, and who knows what John has up his sleeve to wow the Chenouks?

Remember Lee's Optimisation Rule Number One:  First do it the nice way, then (and only then) optimise as necessary.  All else is waste!

See ya,
LeeBB
ps., you really are a very sweet man, Tim.

----- Original Message -----
From: Timothy Heald
 
Lee,
    Man, I don't know what to say, sometimes you amaze me man.  That's a great method for doing menus.  I guess my only question is, what would the extra time cost be like?  I mean yes I imagine that would depend on the size and complexity of the moduled file.
 
    I ask only because I haven't used module for anything yet.  I am going to be using it on my home page here shortly to list guestbook and journal entries, and would hate to slow down the site anymore than the cable company is now :)
 
-----Original Message-----
From: Lee Borkman [mailto:[EMAIL PROTECTED]]

Hi Ron,
 
On simple way is to define a "menu" fuseaction for every circuit.  Then your home layout uses CFMODULE to invoke the appropriate menu:
<cfmodule template="#self#" fuseaction="#fusebox.targetCircuit#.menu">
 
On the other hand, if you want a default menu that individual target circuits can override, then you can define #menuaction# and give it a default of "main.menu", but child circuits' fbx_layouts can override this as they please.
 
The possibilities are many ;-)
 
See you round,
LeeBB

----- Original Message -----
From: Gallant, Ron

I have a layout where the menu is kind of intertwined into it good.  I want
to be able to insert a menu from the current circuit into that spot using
cfmodule.  I do this because I think it's best to have my menu as a
fuseaction.  Easier to control all the links with XFAs.  Anyway, I am
wondering if/how everyone else does this?  I would like to have some sort of
default menu that a circuit could override with it's own menu without having
to recreate the layout for each circuit.



end
***********************************************************
"There are only two ways to live your life.
One is as though nothing is a miracle.
The other is as though everything is a miracle. "

- Albert Einstein (1879-1955)
***********************************************************
Michael "Maxx" Porter
Advanced Macromedia ColdFusion 5.0 Certified Developer

mailto:[EMAIL PROTECTED]

==^================================================================
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