Making the menu dynamic using cold fusion

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
tubize
Advanced
Advanced
Posts: 27
Joined: Tue Sep 30, 2003 9:14 am

Making the menu dynamic using cold fusion

Post by tubize »

I use Cold Fusion extensively on my site and do not know javascript.

Has anyone had any experience making the dhtml vertical menu dynamic by connecting it to a database using Cold Fusion. Besides changing the file suffix to .cfm from .js, what else do you have to do and what should one look out for or avoid?

Thanks.
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Not that hard, actually. I haven't built a full-blown menu system under CF, but I do have a sub-menu pulling some system variables...

Code: Select all

with(milonic=new menuname("system")){	
style=XPMenuStyle;
borderwidth=1;
orientation="vertical";
bgimage="/sai/graphics/winxp_back.gif";
margin=4;
aI("text=Browser: <cfoutput>#cgi.http_user_agent#</cfoutput>;image=/sai/graphics/xpblank.gif;");
aI("text=Code Name: "+navigator.appCodeName+";url=#;image=/sai/graphics/xpblank.gif;");
aI("text=Color Depth: "+screen.colorDepth+" bit;url=#;image=/sai/graphics/xpblank.gif;");
aI("text=IP: <cfoutput>#cgi.remote_addr#</cfoutput>;image=/sai/graphics/xpblank.gif;");
aI("text=Language: "+navigator.browserLanguage+";url=#;image=/sai/graphics/xpblank.gif;");
aI("text=Platform: "+navigator.platform+";url=#;image=/sai/graphics/xpblank.gif;");
aI("text=Screen Max: "+screen.availWidth+"  x  "+screen.availHeight+";url=#;image=/sai/graphics/xpblank.gif;");
aI("text=Screen Resolution: "+screen.width+"  x  "+screen.height+";url=#;image=/sai/graphics/xpblank.gif;");
}
I think you can see the idea from this.

There are a lot of folks on the board running dynamic menus under PHP with no problems, so CF should be the same way. Try a search on PHP if you need to see what they're doing.
John
tubize
Advanced
Advanced
Posts: 27
Joined: Tue Sep 30, 2003 9:14 am

I got it working

Post by tubize »

I have got a dynamic milonic working on my site. I have renamed the menu to .cfm from .js and you have to include it with the javascript include command and not <cfinclude>. I have one question, though.

I have a number of vertical menus on the site and all of them have the same top section describing the general properties. I was hoping that I could set these properties up in one file and include them in each menu with a javascript include but it looks like this does not work.

Does anyone know if there is a way to do this?

It does appear that you can place a javascript include after the menu properties and I guess that you could use a cfif statement to bring in the lower part of the menu but this is a little messier.
Post Reply