I used transMenu:
http://youngpup.net/2004/transmenus/examples

demo:
http://youngpup.net/_projectDirectories/transmenus/demos/photos/index.html

I already had a "pages" database set up in the recursively nested structure
like so:

page_id
page_name
fk_childof (FK to page_id of the parent)

Here's some code if you're interested. You can see the results over at
www.girlscoutsofcv.org. The client originally had multiple nested levels of
menus but opted to go for one level (I left the multiple levels in the code
because it was a LOT of work getting it like that).

First the query to get the pages
<cfquery name="getPages" dataSource="#Application.DSN#"
dbType="#Application.DBType#" username="#Application.username#"
password="#Application.password#">
        SELECT
                top.page_id AS top_id, top.page_name AS top_name,
                mid.page_id AS mid_id, mid.page_name AS mid_name, 
mid.page_sortorder AS
mid_order, mid.page_link AS mid_link,
                sub.page_id AS sub_id, sub.page_name AS sub_name, 
sub.page_sortorder AS
sub_order, sub.page_link AS sub_link,
                bottom.page_id AS bottom_id, bottom.page_name AS bottom_name,
bottom.page_sortorder AS bottom_order, bottom.page_link AS bottom_link
        FROM pages top
        LEFT OUTER JOIN pages mid
                ON mid.page_childof = top.page_id
        LEFT OUTER JOIN pages sub
                ON sub.page_childof = mid.page_id
        LEFT OUTER JOIN pages bottom
                ON bottom.page_childof = sub.page_id
        WHERE top.page_childof = 0
        AND top.page_id IN (2,3,4,5,6,7,8,9)
        GROUP BY top_name, mid_name, sub_name, bottom_name
        ORDER BY top_name, mid_order DESC, mid_name, sub_order DESC, sub_name,
bottom_order DESC, bottom_name
</cfquery>


Then the code to display the menu system:
                <cfoutput query="getPages" group="top_name">
                <cfif mid_id IS NOT "">
                        var menu#top_id# =
ms.addMenu(document.getElementById("#LCase(REReplace(top_name,"[
&!]","","ALL"))#"));
                </cfif>
                        <cfset arraycount = 0>
                        <cfoutput group="mid_name">
                                <cfif mid_name IS NOT "">
                                        <cfset link = Iif(mid_link IS
"",De("page.cfm?pid=#mid_id#"),De("#mid_link#"))>
                                        menu#top_id#.addItem("#mid_name#", 
"#link#");
                                </cfif>
                                <!--- 9/7/2005
                                        <cfif sub_id IS NOT "">
                                                var submenu#mid_id# =
menu#top_id#.addMenu(menu#top_id#.items[#arraycount#]);
                                        </cfif>
                                        <cfset bottomarray = 0>
                                        <cfoutput group="sub_name">
                                                <cfif sub_name IS NOT "">
                                                        <cfset link = 
Iif(sub_link IS
"",De("page.cfm?pid=#sub_id#"),De("#sub_link#"))>
                                                        
submenu#mid_id#.addItem("#sub_name#", "#link#");
                                                </cfif>
                                                        <cfif bottom_id IS NOT 
"">
                                                                var 
submenu#sub_id# =
submenu#mid_id#.addMenu(submenu#mid_id#.items[#bottomarray#]);
                                                        </cfif>
                                                        <cfoutput 
group="bottom_name">
                                                        <cfif bottom_name IS 
NOT "">
                                                                <cfset link = 
Iif(bottom_link IS
"",De("page.cfm?pid=#bottom_id#"),De("#bottom_link#"))>
                                                                
submenu#sub_id#.addItem("#bottom_name#", "#link#");
                                                        </cfif>
                                                        </cfoutput>
                                                <cfset bottomarray = 
bottomarray + 1>
                                        </cfoutput>
                                <cfset arraycount = arraycount + 1>
                                --->
                        </cfoutput>
                </cfoutput>

All of this meshes with the transMenu system. I'm only showing the parts
which contain CF code.


<!----------------//------
andy matthews
web developer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--------------//--------->

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 07, 2005 1:50 PM
To: CF-Talk
Subject: Re[2]: CF Editable Dynamic Menus


Hi Massimo,
that looks quite nice.
But I need at least one layer (clickable section)
more like in: http://www.torquato.de/

Is it possible ?

Uwe

>> Does someone know any dynamic menu system that can be managed/edited
>> from a CF application?

MF> I have two menus available as custom tags. You can take a look here:
MF> http://www.olimpo.ch/tmt/

MF> At least one of the sample shows how the data can be dynamic.
MF> Hope it may help


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:226498
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