I must admit I am with Ben on this one. In the example I provided, there is a function that drills down into the whole menu tree using core FarCry methods. It is recursive and stores child items of the current node in an array. Ultimately, this returns a nested structure that represents the complete menu tree.
All you then need to do if you want to use a different menu system to Suckerfish (which was what I used in my example) is to work out how that particular menu system expects it's HTML to be rendered (as well as any JS and CSS includes that it may require). Then write a method that traverses the nested struct and produces the markup (as Ben has suggested). The example I gave was broken down into those two methods - the business method to get the data from FarCry in a CFMX nested structure and then a method to take that structure and render the XHTML for Suckerfish. In the case of Suckfish, just a few includes for JS and CSS in the <head> section and it all works (although I played around a lot with the styling to make it fit the site design I had). I suppose - to re-iterate - the "menu" system as seen in the browser itself has very little to do with FarCry. You just have to get the "data" from FarCry that makes up the navigation tree created in the Admin tool. And - because multi-level (i.e. more than one leve) drop-down menus require ALL the data up front (cause you have to have all the data on the page because you dont know which menu may be displayed) you have to get ALL the navigations nodes (hence why I wrote one method to just return it all in one nested structure). I suppose you COULD make a menu system that used a call back to the server side to get the next level of menu - but this would be slow and cumbersome and would not produce the desired impact expected by a user of a such a menu system. Regards, Gary On Tue, 30 Nov 2004 13:34:47 +1100, Ben Bishop <[EMAIL PROTECTED]> wrote: > Hi Brant, > > I'm not sure what you mean by "native support for a multi level > navigation system." > > Are you after plug and play drop-down menus, or simply code to build > nested lists? > > Daemon's legendary genericNav was used to great effect on > http://www.nzsteel.co.nz/nz/go/products/colorsteel/colorsteel-endura > > genericNav easily builds the nested lists for > - utility menu > - primary navigation drop-down menus (using the Suckerfish method) > - secondary navigation (accordion style) > - footer links > > Farcry's standard Tree functions (such as getChildren) are used to get > the data, then the mark-up generator builds the list levels. > > With all presentation styling handled by CSS, the result is lightweight, > clean and valid xhtml mark-up. > > Is this the sort of thing people want code for? > > Regards, > > Ben > http://farry.daemon.com.au/ > > > > > Brant Winter wrote: > > Hi - I have been looking through the archives for information on building > > navigation items with <ul> / <li> tags. Gary Menzel gave me some code to > > help along the way, but I am looking for something that I can pull apart and > > learn how to build a menu system. > > > > > downside to Farcry at present, for me anyway, is the lack of native support > > for a multi level navigation system. Can anyone help me out with some code > > etc. I have read about the Brain Jar menus, but can't find a working block > > of code that I can reverse engineer. > > --- > You are currently subscribed to farcry-dev as: [EMAIL PROTECTED] > To unsubscribe send a blank email to [EMAIL PROTECTED] > Aussie Macromedia Developers: http://lists.daemon.com.au/ > --- You are currently subscribed to farcry-dev as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/
