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:33

One menu for all????


Poster: Matt Stano
Dated: Tuesday September 6 2005 - 3:39:21 BST

Ok, I'm relatively new to the 5 version, was using 3.0 So how do I make all the webpages call just one single menu array? Is there a global command of some sort? So I've basically taken the sample and changed the words and pointers so far. Added the little bit code to my main index page and that's where I am. Any help would be much appreciated.

Thanks,

Matt


Poster: Ruth
Dated: Wednesday September 7 2005 - 19:25:32 BST

Hi Matt,

I'm not sure I understand what you mean.

If you have created a menu_data.js file with all your information in it, then you would just place the call for all the menu files on each page just like you had to do with the version 3.

Or are you by chance using frames?

Ruth

One menu for all????


Poster: Matt Stano
Dated: Thursday September 8 2005 - 15:03:47 BST

Hi Ruth, thanks for the reply. I'm coming from the old 3.3 version of DHTML so I'm having a little trouble in translation. Here's what happens:
I have (in my mind) a fairly simple folder layout where individual pages are located; ie:
-root
--tech
---newsletters
---videos
--calendars
---building
---foodservice

well you get the idea...
So my issue is that on the top level the navigation from DHTML works great, but when I go to a page, in say the, root\tech\newletters folder and then jump to root\calendars\building I have an issue with my path. The navigation once I'm deep in the folder structure needs to be adjusted to ..\..\calendars\building. So I wind up having multiple menu scripts. What is the simpliest way to make this work for me so I don't need to have more than one menu script? Is it possible? Thanks for your help.

Matt


Poster: John
Dated: Thursday September 8 2005 - 15:37:09 BST

I call my menu code files with an include like this...
Code:
<script language="javascript" src="/sa/menu5/milonic_src.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
<!--
if(ns4)_d.write("<scr"+"ipt language=javascript src=/sa/menu5/mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=javascript src=/sa/menu5/mmenudom.js><\/scr"+"ipt>");
-->
</script>

The leading / in the path means the call is server-relative, so regardless of the level from which the call is made the files will always be found. My _data files, being different for each of the 25 or so sites I handle, are included on the individual pages in a td.

BTW, your '..\..\calendars\building' should be ../../calendars/building, etc., but don't get into that kind of addressing. It's much too restrictive.

One menu for all????


Poster: Matt Stano
Dated: Thursday September 8 2005 - 17:01:08 BST

Hi John, thanks. So let me get this part straight. You have individual menu_data.js files for each page?

here is the code from my main page:



<script type="text/javascript" src="java2/milonic_src.js"></script>
<script type="text/javascript">

if(ns4)_d.write("<scr"+"ipt type=text/javascript src=java2/mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt type=text/javascript src=java2/mmenudom.js><\/scr"+"ipt>");
</script>

<script type="text/javascript" src="java2/menu_data.js"></script>


It looks like yours, maybe I'm missing something. You said that the menu_data are on the individual pages in a table. Are these menu structures altered to account for being deeper in the folder structure?

and lastly you said:
"../../calendars/building, etc., but don't get into that kind of addressing. It's much too restrictive."

Ok, I give, what other way would you address it? I'm kind of a newbie to the java side of things. Is there really an easier way?
Thanks for your guidance.

Matt


Poster: Ruth
Dated: Thursday September 8 2005 - 18:23:30 BST

Hi,

I think what John meant [boy I hate paths] is that the
Code:
"/sa/menu5/milonic_src.js"
having the / in front of the sa folder name says that the file is in
Code:
"rootdirectory/sa/menu5/milonic_src.js"


:oops: I gave up and I just use darned full paths....

Ruth


Poster: John
Dated: Thursday September 8 2005 - 21:41:05 BST

Ruth is correct. The leading / starts the search from the root level of my server, regardless of what 'level' I might be on in the menu structure (or any other, for that matter). In this case, my full path is http://www.west.asu.edu/sa/menu5/milonic_src.js, but why type all that every time?

This is especially handy for those times you might move a file to another directory or 'level'. Doesn't matter where you put the file, /sa/menu5/milonic_src.js will always start at the root and find this file, regardless. No more ../../ junk.

One menu for all????


Poster: Matt Stano
Dated: Monday September 12 2005 - 16:03:28 BST

Hi John and Ruth,

So I did a lot work and figured out what you guys were telling me. I posted on the server and the pathing began to work as you described. Which is fantastic!! Thanks a bunch. Just one little sticky point. Inside the menu_data.js there is a line for the menu image, a down arrow for me. When I've moved to a page that is deeper in the folder structure I don't see the image anymore. I'm not changing the menu_data.js file. Is there something I need to do there that will fix it?

Thanks again for all your help.

Matt

One menu for all????


Poster: Matt Stano
Dated: Monday September 12 2005 - 16:07:30 BST

Ok, I figured it out. I just went back to the menu_data.js file and where it asks me for:

subimage="java2/arrowdn.gif";

I added the forward slash to make it a universal path. So now it reads:

subimage="/java2/arrowdn.gif";


Alright, I feel better for figuring that one out. :-)

Thanks.