Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:40

Milonic Meets Cold Fusion


Poster: xaoscontrol
Dated: Tuesday March 2 2004 - 16:39:40 GMT

Simply put, I cannot get the menu to show up assumingly because of the new way we're doing things.

We're doing something different with our site structures in order to make things simpler on the webmaster side. I'm going to try to give you as much info as possible so you can understand what's happening on my end.

We have our site's root folder and within the root there are three directories:

Includes (for cf includes)

Images ( for images...duh)

content folder ( for content pages)

In the content folder, we have our application.cfm aling with the app_globals, app_layout, app_server and basic content pages as mentioned before.

Includes are the header, footer and sidebar (the milonic JS code pages are in here as well)

The application file, which will one of the few I will have to mess with when we deside to change the overall look of the site, has the following code in it.

This is the only code that should matter at this point



Code:
   
<cflock scope="application" timeout="30">
<cfset application.cfroot="nopinationals.com">
<cfset application.webroot="">
<cfset application.imagesroot="../images">
<cfset application.header="../includes/nats_2k4_head_1.cfm">
<cfset application.sidebar="nats_2k4_side_1.cfm">
<cfset application.footer="../includes/nats_2k4_foot_1.cfm">
<cfset application.maindsn="NNRegistration">
cfset application.timespan="#createtimespan(1,0,0,0)#">
<cfset application.domain="">
</cflock>


the lines application.header, sidebar and footer all refer to the three main elements of our pages aside from the content. It calls the header and footer like this:

Code:
<cfinclude template="#application.header#">

ipsum loreum

<cfinclude template="#application.footer#">


Header page has it's content and calls the sidebar navigation (our beloved menu)

Code:

<cfinclude template="#application.sidebar#">



And here's the sidebar's code

Code:

<SCRIPT language=JavaScript src="milonic_src.js" type=text/javascript></SCRIPT>

<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");
</script>

<SCRIPT language=JavaScript src="menu_data.js" type=text/javascript></SCRIPT>



Not sure if the paths for the above code are wrong. I've tried testing the header by way of IE (localhost:8500/root/includes/nats_2k4_head_1.cfm) which results in my getting an error saying that the scope is wrong. However if I test a page inlcuding the header with sidebar and the footer, the page runs fine but the menu doesn't come up. I viewed the source code and it shows that the menu is in there as it should be if it ran.

Maybe someone can give me an insight?


Poster: Maz
Dated: Tuesday March 2 2004 - 19:13:00 GMT

I really don't have a clue, except that you may need to consider the path with a /slash before from the root, wherever that is.

maz


Poster: xaoscontrol
Dated: Tuesday March 2 2004 - 19:28:03 GMT

I may not have been clear about the root folder part:

root folder
>includes (milonic menu files sit here)
>images
>subdirectory (content pages)

I've tried just creating a basic page with the code to call all the js files and that didn't even work. Though i did try double clicking on the file to open in IE and it worked fine.

Stumped.

Re: Milonic Meets Cold Fusion


Poster: John
Dated: Tuesday March 2 2004 - 20:42:16 GMT

xaoscontrol wrote:
Code:
<cflock scope="application" timeout="30">
<cfset application.cfroot="nopinationals.com">
<cfset application.webroot="">
<cfset application.imagesroot="../images">
<cfset application.header="../includes/nats_2k4_head_1.cfm">
<cfset application.sidebar="nats_2k4_side_1.cfm">
<cfset application.footer="../includes/nats_2k4_foot_1.cfm">
<cfset application.maindsn="NNRegistration">
cfset application.timespan="#createtimespan(1,0,0,0)#">
<cfset application.domain="">
</cflock>

You're missing a < on application.timespan.

What Maz is saying, and I agree, is we'd rather see this...
Code:
<cflock scope="application" timeout="30">
<cfset application.cfroot="nopinationals.com">
<cfset application.webroot="">
<cfset application.imagesroot="/images">
<cfset application.header="/includes/nats_2k4_head_1.cfm">
<cfset application.sidebar="nats_2k4_side_1.cfm">
<cfset application.footer="/includes/nats_2k4_foot_1.cfm">
<cfset application.maindsn="NNRegistration">
<cfset application.timespan="#createtimespan(1,0,0,0)#">
<cfset application.domain="">
</cflock>

Server-relative.

Menu JS calls look OK.


Poster: xaoscontrol
Dated: Wednesday March 3 2004 - 17:06:14 GMT

That missing "<" from the CFSET was a result of not copying all of the text from the page. My bad.

i did get the side bar include to come up but the menu doesn't come up at all. I have a douple of other sites on my machine that use the menu and they seem fine. I did notice two things:

In pondering about the possibility that it didn't like the way the folders were set up and where it sat in relation to the root folder, I tried using the menu in another folder at the WWWRoot and it still had issues. then we tried the same menu on another machine, just in case it was a problem with the menu. That time, the menu worked. Not sure if that gives more insite. Just a troubleshooting task, really.


Poster: John
Dated: Thursday March 4 2004 - 14:05:51 GMT

I've pretty much buried the menu code on my CF server...

/sai/templates/menu5/

Using server-relative addressing in my <cfinclude> for the menu calls...
Code:
<script language="JavaScript" src="/sai/templates/menu5/milonic_src.js" type="text/javascript"></script>   
<script   language="JavaScript" type="text/javascript">
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=/sai/templates/menu5/mmenuns4.js><\/scr"+"ipt>");      
else _d.write("<scr"+"ipt language=JavaScript src=/sai/templates/menu5/mmenudom.js><\/scr"+"ipt>");</script>
<script language="JavaScript" src="/sai/templates/menu5/xp_data.cfm" type="text/javascript"></script>

...results in no troubles at all regardless of the depth of the calling page.

Almost sounds like you have an issue with that one machine.


Poster: Martin
Dated: Saturday March 6 2004 - 1:40:57 GMT

JS-Path statements or other path statements inside of a template to include should point like they where set in the calling template. An cfinclude "includes" a template inside of the calling template.

the calling template (mostly index.cfm) is the big boss.

Don't get confused about our "relative" world.

By the way: Add an type="Exclusive" to your cflock, if you're writing variables.


Poster: xaoscontrol
Dated: Thursday March 18 2004 - 17:32:08 GMT

///note: I chose to not use the milonic menu on that perticular site due to time constraints. However, one of our other sites, which we planned on using the menu in is also having issues using the same format as the site I had mentioned. So I'm still in need of help//

The application.cfm file sits in the same folder as all of the rest of the .cfm files with exception to the header, footer and sidebar cfm files which sit in the includes folder.

It was mentioned in a previous post that I should kill the '../" paths in the application.cfm.

Code:
<cflock scope="application" timeout="30">
<cfset application.cfroot="nopinationals.com">
<cfset application.webroot="">
<cfset application.imagesroot="../images">
<cfset application.header="../includes/nats_2k4_head_1.cfm">
<cfset application.sidebar="nats_2k4_side_1.cfm">
<cfset application.footer="../includes/nats_2k4_foot_1.cfm">
<cfset application.maindsn="NNRegistration">
cfset application.timespan="#createtimespan(1,0,0,0)#">
<cfset application.domain="">
</cflock>


the reason the "../" is before each include is because each page (we'll say default.cfm) has <cfinclude template="#application.header#"> (or application.footer, etc) in each page. The page looks to the application file for what is supposed to sit in that position. The application file tells default.cfm that the include it's looking for is outside of the folder that default.cfm sits in, and in a folder called includes. This folder sits at the root level as does the folder that the default.cfm file sits in.

Hoping that makes more sense.


Poster: Martin
Dated: Thursday March 18 2004 - 23:56:46 GMT

Hi xaoscontrol,

Actually i can't see your problem...


Poster: xaoscontrol
Dated: Friday March 19 2004 - 15:02:24 GMT

Not sure what you mean..so I'll reiterate..

My menu isn't showing up...that's really the problem. I don't know if it has to do with directories and paths and where the .js files are located in relation to the pages.

Normally we'd have a directory and within that directory, we'd have our content pages, images folder and includes folder. In this case, we've got the root level directory, then within there, we have three separate directories : one for content pages (default.cfm, etc), one for images and one for includes. My milonic files sit in the includes folder. In fact, I have a .cfm file that has the lines of SCRIPT code in there as well. The reason for doing it this way was to make the overall design change easy if we chose to change the color or something for one day.

In any case, the menu doesn't want to work for some reason. My thoughts are that the menu doesn't like being placed in a folder and ultimatly being called by a document in a sibling folder (sibling rivalry in the WWW? Yes, I went there.)...but my manager thinks that it should work and directories have little to do with it.


Poster: Martin
Dated: Friday March 19 2004 - 15:24:43 GMT

Do you have an url to watch??


Poster: xaoscontrol
Dated: Friday March 19 2004 - 16:12:50 GMT

I don't because we're still testing it locally. I could post code if that helps.