Milonic Meets Cold Fusion

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
xaoscontrol
Advanced
Advanced
Posts: 12
Joined: Fri Dec 05, 2003 6:46 pm

Milonic Meets Cold Fusion

Post by xaoscontrol »

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: Select all

	
<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: Select all

<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: Select all


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

And here's the sidebar's code

Code: Select all


<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?
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

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
xaoscontrol
Advanced
Advanced
Posts: 12
Joined: Fri Dec 05, 2003 6:46 pm

Post by xaoscontrol »

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.
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Re: Milonic Meets Cold Fusion

Post by John »

xaoscontrol wrote:

Code: Select all

<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: Select all

<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.
John
xaoscontrol
Advanced
Advanced
Posts: 12
Joined: Fri Dec 05, 2003 6:46 pm

Post by xaoscontrol »

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.
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

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: Select all

<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.
John
User avatar
Martin
Mega User
Mega User
Posts: 113
Joined: Fri Jul 05, 2002 11:57 pm
Location: Zollikon, Switzerland

Post by Martin »

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.
cheers

====================================
Merlin Consulting
Martin Schaible
Bahnhofstrasse 27
CH-8702 Zollikon
====================================
xaoscontrol
Advanced
Advanced
Posts: 12
Joined: Fri Dec 05, 2003 6:46 pm

Post by xaoscontrol »

///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: Select all

<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.
User avatar
Martin
Mega User
Mega User
Posts: 113
Joined: Fri Jul 05, 2002 11:57 pm
Location: Zollikon, Switzerland

Post by Martin »

Hi xaoscontrol,

Actually i can't see your problem...
cheers

====================================
Merlin Consulting
Martin Schaible
Bahnhofstrasse 27
CH-8702 Zollikon
====================================
xaoscontrol
Advanced
Advanced
Posts: 12
Joined: Fri Dec 05, 2003 6:46 pm

Post by xaoscontrol »

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.
User avatar
Martin
Mega User
Mega User
Posts: 113
Joined: Fri Jul 05, 2002 11:57 pm
Location: Zollikon, Switzerland

Post by Martin »

Do you have an url to watch??
cheers

====================================
Merlin Consulting
Martin Schaible
Bahnhofstrasse 27
CH-8702 Zollikon
====================================
xaoscontrol
Advanced
Advanced
Posts: 12
Joined: Fri Dec 05, 2003 6:46 pm

Post by xaoscontrol »

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