Cold Fusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Iron Speed
 
Go Back   Dev Articles Community ForumsProgrammingCold Fusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old February 28th, 2007, 04:25 AM
richardgroen richardgroen is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Posts: 1 richardgroen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 48 sec
Reputation Power: 0
Dynamic menu. How to?

I am looking for a dynamic menu for my website but i cant figure out how.
I want to have a menu like this: (horizontally aligned)

1Start 2Information 3Contact
1about us 2contact form 3address
1company 2flyers 3email

The 'Start', 'Information' and 'Contact' items are the headmenu items.
The about us, contact form etc are the submenu items

I have a relational database with two tables. In one I have the headmenu items and the second one the submenu items. In the submenu table i have a ID reference to the headmenu id so these two can be linked.

<!--- variables of the get_headmenu are #headmenuname# This is the title of the headmenu --->
<cfquery name="get_headmenu" datasource="#dsn#">
Select *
from tbl_headmenu
</cfquery>

<!--- the submenu name variable is #submenuname# --->
<cfquery name="get_submenu" datasource="#dsn#">
Select *
from tbl_submenu
where tbl_headmenuid = #get_headmenu.id#
</cfquery>

The two queries must be added together in order to create a dynamic menu.

Can somebody help me please?

Thanks,
Richard.

Reply With Quote
  #2  
Old March 12th, 2008, 10:49 PM
hexeliebe hexeliebe is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 5 hexeliebe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 33 m 38 sec
Reputation Power: 0
Quote:
Originally Posted by richardgroen
I am looking for a dynamic menu for my website but i cant figure out how.
I want to have a menu like this: (horizontally aligned)

1Start 2Information 3Contact
1about us 2contact form 3address
1company 2flyers 3email

The 'Start', 'Information' and 'Contact' items are the headmenu items.
The about us, contact form etc are the submenu items

I have a relational database with two tables. In one I have the headmenu items and the second one the submenu items. In the submenu table i have a ID reference to the headmenu id so these two can be linked.

<!--- variables of the get_headmenu are #headmenuname# This is the title of the headmenu --->
<cfquery name="get_headmenu" datasource="#dsn#">
Select *
from tbl_headmenu
</cfquery>

<!--- the submenu name variable is #submenuname# --->
<cfquery name="get_submenu" datasource="#dsn#">
Select *
from tbl_submenu
where tbl_headmenuid = #get_headmenu.id#
</cfquery>

The two queries must be added together in order to create a dynamic menu.

Can somebody help me please?

Thanks,
Richard.


This is more of a SQL question than one for CF, although the solution will require you to do an external and internal loop using group to get the right layout.

here is the sql.
<cfquery name="getMenu" datasource="#dsn#">
Select
h.item[1] AS headID
,h.itme[2] AS head
,s.item[1] AS Sub
,s.item[2] AS sheadid--foreign key to headid
from tbl_headmenu h
LEFT JOIN tbl_submenu s
ON s.[headMenu]id = h.id
order by h.item[1],s.item[1]
</cfquery>

This will give you a list of header menus and their associated subs then you output like this.

<cfoutput query=getMenu group='h.item[1]'>
#head
<cfloop >
<cfif sheadid eq headid>
<cfoutput>#sub#</cfoutput><BR>
</cfif>
</cfloop>
</cfoutput>

you'll have to play with it for a bit since it's been about five years since I programmed like this but with no more information this is the easiest way to get it accomplished.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingCold Fusion Development > Dynamic menu. How to?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway