Hi,

This will only work if there is only one preset menu. The actual code will look more like this:

<script language="JavaScript1.2">
dqm__subdesc2_0 = "Home" ;
dqm__subdesc2_1 = "News" ;
dqm__subdesc3_0 = "Links" ;
dqm__subdesc3_1 = "More Links" ;
dqm__subdesc3_2 = "Hot Links" ;
dqm__url2_0 = "index.cfm";
dqm__url2_1 = "news.cfm" ;
dqm__url3_0 = "links.cfm" ;
dqm__url3_1 = "morelinks.cfm" ;
dqm__url3_2 = "hotlinks.cfm" ;
<cfoutput query="menu">
dqm__subdesc#num#_#subnum# = "#pagetitle#";
dqm__url#num#_#subnum# = "#url#";
</cfoutput>
</script>

Would it be better to store the #num# and #subnum# in the db next to the pagetitle record and then if a page is deleted resort the numbering? Or is there an easier way. Is there any way to build this into a 2d array? I have never got to grips with arrays but they may help?

Cheers

Dave

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]

============================================
Phipps CF Development
Oxford, Oxfordshire.
Telephone: +44(0)7718 896696
http://www.phipps-cf.co.uk
============================================


--
** 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]

Reply via email to