Hello Dave,
try something like this... I haven't tested this, but it looks ok...
use the id/parentid for your group parameter to diferentiate the two
levels of the menu.
<script language="JavaScript1.2">
<CFSet Level = 0>
<cfoutput query="menu" group="level">
<CFSet Level = Level+1>
dqm__subdesc#Level#_0 = "Home" ;
dqm__url#Level#_0 = "index.cfm";
<CFSet Level2 = 0>
<cfoutput>
<CFSet Level2 = Level2+1>
dqm__subdesc#Level#_#Level2# = "#pagetitle#";
dqm__url#Level#_#Level2# = "#url#";
</cfoutput>
</cfoutput>
</script>
Kind Regards,
Christopher Dawes
Dawes International
Tuesday, February 18, 2003, 7:18:32 PM, you wrote:
DP> Hi,
DP> This will only work if there is only one preset menu. The actual code will
DP> look more like this:
DP> <script language="JavaScript1.2">
DP> dqm__subdesc2_0 = "Home" ;
DP> dqm__subdesc2_1 = "News" ;
DP> dqm__subdesc3_0 = "Links" ;
DP> dqm__subdesc3_1 = "More Links" ;
DP> dqm__subdesc3_2 = "Hot Links" ;
DP> dqm__url2_0 = "index.cfm";
DP> dqm__url2_1 = "news.cfm" ;
DP> dqm__url3_0 = "links.cfm" ;
DP> dqm__url3_1 = "morelinks.cfm" ;
DP> dqm__url3_2 = "hotlinks.cfm" ;
DP> <cfoutput query="menu">
DP> dqm__subdesc#num#_#subnum# = "#pagetitle#";
DP> dqm__url#num#_#subnum# = "#url#";
DP> </cfoutput>
DP> </script>
DP> Would it be better to store the #num# and #subnum# in the db next to the
DP> pagetitle record and then if a page is deleted resort the numbering? Or is
DP> there an easier way. Is there any way to build this into a 2d array? I
DP> have never got to grips with arrays but they may help?
DP> Cheers
DP> Dave
DP> At 05:17 2/18/2003 +1100, you wrote:
>>Hello Christopher,
>>
>> whoops...
>>
>> <script language="JavaScript1.2">
>> dqm__subdesc2_0 = "Home" ;
>> dqm__url2_0 = "index.cfm";
>> <cfoutput query="menu">
>> dqm__subdesc2_#CurrentRow# = "#pagetitle#";
>> dqm__url2_#CurrentRow# = "#url#";
>> </cfoutput>
>> </script>
>>
>>Kind Regards,
>>Christopher Dawes
>>Dawes International
>>
>>Tuesday, February 18, 2003, 5:14:56 AM, you wrote:
>>
>>CD> Hello Dave,
>>
>>CD> how about this:
>>
>>CD> <script language="JavaScript1.2">
>>CD> dqm__subdesc2_0 = "Home" ;
>>CD> dqm__url2_0 = "index.cfm";
>>CD> <cfoutput query="menu">
>>CD> dqm__subdesc#CurrentRow#_#sub# = "#pagetitle#";
>>CD> dqm__url#CurrentRow#_#sub# = "#url#";
>>CD> </cfoutput>
>>CD> </script>
>>
>>CD> Kind Regards,
>>CD> Christopher Dawes
>>CD> Dawes International
>>
>>CD> Tuesday, February 18, 2003, 4:25:44 AM, you wrote:
>>
>>DP>> Hi,
>>
>>DP>> I have a DHTML menu system which I am trying to integrate into a CF
>>app. I
>>DP>> have certain items which are fixed and the rest will be driven from the
>>DP>> db. I have discovered that the numbering needs to be consecutive and
>>DP>> cannot have gaps. Here's a code snippet:
>>CD> xc
>>DP>> <script language="JavaScript1.2">
>>DP>> dqm__subdesc2_0 = "News Service" ;
>>DP>> dqm__subdesc2_1 = "Flame";
>>DP>> dqm__subdesc2_2 = "Diary";
>>DP>> dqm__subdesc2_3 = "Conference";
>>DP>> dqm__subdesc2_4 = "Media Office";
>>DP>> dqm__subdesc2_5 = "Grants & Funds";
>>DP>> dqm__subdesc2_6 = "Campaigns";
>>DP>> dqm__url2_0 = "index.cfm";
>>DP>> dqm__url2_1 = "index.cfm";
>>DP>> dqm__url2_2 = "index.cfm";
>>DP>> dqm__url2_3 = "index.cfm";
>>DP>> dqm__url2_4 = "index.cfm";
>>DP>> dqm__url2_5 = "index.cfm";
>>DP>> dqm__url2_6 = "index.cfm";
>>DP>> ....
>>DP>> </script>
>>
>>DP>> What I need is like this:
>>
>>DP>> <script language="JavaScript1.2">
>>DP>> dqm__subdesc2_0 = "Home" ; //This is a fixed menu
>>DP>> <cfoutput query="menu">
>>DP>> dqm__subdesc#Num#_#sub# = "#pagetitle#";
>>DP>> </cfoutput>
>>DP>> dqm__url2_0 = "index.cfm"; //This is a fixed item
>>DP>> <cfoutput query="menu">
>>DP>> dqm__url#Num#_#sub# = "#url#";
>>DP>> </cfoutput>
>>DP>> ....
>>DP>> </script>
>>
>>DP>> The problem I am finding is calculating #Num# and #sub# which need to
>>DP>> follow exactly otherwise the javascript will break. Does anyone know
>>of a
>>DP>> way to solve this?
>>
>>DP>> Cheers
>>
>>DP>> Dave
>>
>>
>>--
>>** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
>>
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>For human help, e-mail: [EMAIL PROTECTED]
DP> ============================================
DP> Phipps CF Development
DP> Oxford, Oxfordshire.
DP> Telephone: +44(0)7718 896696
DP> http://www.phipps-cf.co.uk
DP> ============================================
--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]