I'm with Ben.  Just make sure you carefully consider whether a menu
item has a submenu (as Ben's example shows) or submenus are menuitems
themselves.

The former lets you assign a link to something with a subment (so you
can either click it to do something, or go to it's children), while
the latter says every item on the menu is EITHER a link OR a submenu
container.

Both are valid, but your XML format will depend on which you need to
use.  For navigation, I generally prefer the latter, as it keeps thing
simpler for users, as that's the way most client apps work.

cheers,
barneyb

On 5/24/06, Ben Nadel <[EMAIL PROTECTED]> wrote:
> What about XML style:
>
> <cfsavecontent variable="strMenuXmlData">
>   <menu>
>     <item>
>       <text>A link</text>
>       <link>http://www.google.com</link>
>     </item>
>     <item>
>       <text>A link</text>
>       <link>http://www.google.com</link>
>       <menu>
>         <item>
>           <text>Sub A link</text>
>           <link>http://www.google.com</link>
>         </item>
>         <item>
>           <text>Sub A link</text>
>           <link>http://www.google.com</link>
>         </item>
>       </menu>
>     </item>
>     <item>
>       <text>A link</text>
>       <link>http://www.google.com</link>
>     </item>
>   </menu>
> </cfsavecontent>
>
> <cfset xmlMenuData = XmlParse( Trim( strMenuXmlData ) ) />
>
>
> .......................
> Ben Nadel
> www.bennadel.com
>
> -----Original Message-----
> From: Ian Skinner [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, May 24, 2006 1:21 PM
> To: CF-Talk
> Subject: Better way to describe a menu.
>
> I'm trying to create dynamic menu that can be easily described in a
> variable.  My first attempt feels very clunky.  Can anybody suggest a
> cleaner and/or more efficient way to describe a nested menu?
>
> My first Attempt:
> menu = arrayNew(1);
> menu[1] = structNew();
> menu[1].text = "A link";
> menu[1].link = "http://www.google.com";;
>
> menu[2] = structNew();
> menu[2].text = "B link";
> menu[2].link = "http://www.google.com";;
>
>   menu[2].subMenu = arrayNew(1);
>   menu[2].subMenu[1] = structNew();
>   menu[2].subMenu[1].text = "subMenu 1";
>   menu[2].subMenu[1].link = "http://www.google.com";;
>
>
> --------------
> Ian Skinner
> Web Programmer
> BloodSource
> www.BloodSource.org
> Sacramento, CA
>
> ---------
> | 1 |   |
> ---------  Binary Soduko
> |   |   |
> ---------
>
> "C code. C code run. Run code run. Please!"
> - Cynthia Dunning
>
> Confidentiality Notice:  This message including any attachments is for the
> sole use of the intended
> recipient(s) and may contain confidential and privileged information. Any
> unauthorized review, use, disclosure or distribution is prohibited. If you
> are not the intended recipient, please contact the sender and delete any
> copies of this message.
>
>
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:241327
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to