installation problem ("scriptpath" variable)

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
Marc-Andre.Roberge@mus.ul
Super Advanced
Super Advanced
Posts: 47
Joined: Sun May 19, 2002 7:23 pm
Location: Québec, QC, Canada
Contact:

installation problem ("scriptpath" variable)

Post by Marc-Andre.Roberge@mus.ul » Thu Aug 21, 2003 10:18 pm

I have installed version 5 in "d:\gdrm\version5\" for testing purposes. The files milonic_src.js, mmenudom.js, and mmenuns.js are located in that directory. My personalized file, updated to version 5 format (menugdrm.js) is also in that directory. My index page, also located in the same directory, contains the following statements:

Code: Select all

<script language=JavaScript src="milonic_src.js" type=text/javascript></script>
<script language=JavaScript src="menugdrm.js" type=text/javascript></script>
Everything works fine as described above. However, when I try to do things for real I bump into a wall. My site is located in "d:\gdrm\", and this is where my index.htm file is located as well. All my ".js" files are in "d:\gdrm\scripts\". My index file, which is in "d:\gdrm\" contains the following statements:

Code: Select all

<script language=JavaScript src="scripts/milonic_src.js" type=text/javascript></script>
<script language=JavaScript src="scripts/menugdrm.js" type=text/javascript></script>
My page now displays but _without_ menu, and with errors on page. There is a line in milonic_src.js that reads scriptpath="". If there something I must add there and/or are my relative references all wrong? It may sound amateurish, but relative references always cause me difficulties. Does the code above need to be located in a specific place on the page? My Milonic lines have always been between the <body> tags. What is the ideal location for the files milonic_src.js, mmenudom.js, and mmenuns.js?

Looking at various messages I have a feeling that this scriptpath variable and the location of the various files is causing a lot of problems to many people -- and I appear to be one of them. Andy's note about that line in milonic_src.js might include a detailed example; I think that this would be helpful. Maybe a short tutorial on where and how to install the various files would be appreciated.

Thanks in advance for any help, with apologies if this topic is brought up again, as annoying it can be for specialist coders.

User avatar
Andy
Milonic
Milonic
Posts: 3307
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy » Thu Aug 21, 2003 11:24 pm

What you need to do is tell the menu where the files are.

As you seem to be building your site using file:// as opposed to http:// (hard drive as ossposed to web server) there are a few things you need to do.

In order to standardize things, you'll need to put the menu inside a directory in the root of your D drive. Something like D:\dhtmlmenu\ is one example but the name really is up to you. The main thing is letting the menu know where these files are and that's the job of the scriptpath variable.

The reason for putting the menu files inside the root of drive D is so that your menu will work the same both locally from your hard disk drive and remotely from your web server (provided you are using MSIE)

Your menu calls should look something like this

Code: Select all

<script language=JavaScript src="/dhtmlmenu/milonic_src.js" type=text/javascript></script> 
<script language=JavaScript src="/dhtmlmenu/menugdrm.js" type=text/javascript></script>
and scriptpath should be

Code: Select all

scriptpath=/dhtmlmenu/;
The most important thing to remember is to prefix the location with the / character. This tells the system to look for the files from the very start of the drive, ie, the root. This means that you can put the menu inside any sub directory and the menu will still know where the files are.

I'm sorry if I've covered things you already know about direcotory structures or sound a little patronizing but it's difficult to explain. Hopefully as more documentation is added it should be easier to use.

Cheers
Andy

Marc-Andre.Roberge@mus.ul
Super Advanced
Super Advanced
Posts: 47
Joined: Sun May 19, 2002 7:23 pm
Location: Québec, QC, Canada
Contact:

Post by Marc-Andre.Roberge@mus.ul » Fri Aug 22, 2003 3:12 pm

Andy,

You have not been patronizing at all; this is exactly the kind of advice I was looking for, and I thank you very much for your reply. Yes, indeed, I am working from my hard drive and copy the files to the server once I am finished. What I see at the top of my screen is "d:\gdrm" for the local folder and "/gdrm/" for the remote site. The server has a directory for me ("roberge") and then several subdirectories, one of which is "gdrm", with a structure that exactly parallels my local site.

I am not too sure about your saying that "putting the files inside the root of drive D" is the thing to do. I am using Dreamweaver, and it seems that all the files connected with my site have to be within "d:\gdrm\". After all, I need to be able to see a full listing of my files in one place, not in two. So what I did is this:

Code: Select all

<script language=JavaScript src="/gdrm/scripts/milonic_src.js" type=text/javascript></script>
<script language=JavaScript src="/gdrm/scripts/menugdrm.js" type=text/javascript></script>
My scriptpath variable in milonic_src.js is shown below. You will note that, contrary to what appears in your message, I had to put the variable within quotation marks. This was the only way to get things to work. Could you have forgotten the quotes? Things do not work without them.

Code: Select all

scriptpath="/gdrm/scripts/";
The coding thus looks exactly as you suggest, except that I added one directory sublevel to all paths.

Curiously, when I copy my index.htm file (located in "d:\gdrm") and the script files (located in "d:\gdrm\scripts\") onto the server, the menu does not appear. What is still wrong with my references so that the menu shows up on my computer and not on the server? Is there a modification that has to be made to the files on the server or on both sides?

I thank you very much for any further help and congratulate you on this wonderful menu. So far, my main reason for upgrading from 3 to 5 is the scroll variable, which is helpful as two of my menu entries have lots of subentries. I may discover further reasons as I study the documentation.

User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio » Fri Aug 22, 2003 3:18 pm

Marc-Andre, It looks as though your paths are correct. Do you have the identical directory structure on your server? :? Also do you have a URL for the server (even an IP address) so that we may look at it. I can almost guarantee we'll be able to get your menu working in hours, if not minutes, if are able to see the set up on your server. ;)
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."

Marc-Andre.Roberge@mus.ul
Super Advanced
Super Advanced
Posts: 47
Joined: Sun May 19, 2002 7:23 pm
Location: Québec, QC, Canada
Contact:

Post by Marc-Andre.Roberge@mus.ul » Fri Aug 22, 2003 3:33 pm

Hergio,

Both directory structures are exactly similar. I have copied index.htm as well as the three js files from my local site to the server at

http://www.mus.ulaval.ca/roberge/gdrm/index.htm. The references to the new menu are for now only in index.htm. This means that loading any of the pages referred to in the menu will return a Not Found until I modify my template and update all the pages. The menu should appear horizontally just below the big beige stub.

Thanks for any help. From what I gather from various postings, you seem to be a very resourceful person.

User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio » Fri Aug 22, 2003 3:37 pm

Got it, problem lies in your mappings. You have an extra directory in there (whether it be real or virtual) called roberge. If you put /roberge/ in front of gdrm I can access your scripts. You need to look at the mappings from the view of the webbrowser, what address if put into the URL of my browser will get me to the script files, and then THAT should be your /...directory.../milonic_src.js and scriptpath="/..directory../". Give it a try!

Oh and thank you. ;)
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."

Marc-Andre.Roberge@mus.ul
Super Advanced
Super Advanced
Posts: 47
Joined: Sun May 19, 2002 7:23 pm
Location: Québec, QC, Canada
Contact:

Post by Marc-Andre.Roberge@mus.ul » Fri Aug 22, 2003 3:57 pm

Hergio,

Thanks for such a prompt reply. I added the name of my subdirectory, so that the reference to the scriptpath variable now reads "/roberge/gdrm/scripts/". I also updated the two references in milonic_src.js. My menu now displays on the server, but no longer displays on my local site. I just only moved the problem from one place to another. So far, using version 3.5 of the menu, I simply copied to the server exactly what I have on my disk and everything worked perfectly without any modification. Is there something in Andy's coding that makes it more difficult to achieve such a simple updating of a site?

When I look in Dreamweaver under "Define Sites...". I see in my Remote Info that my host directory is /gdrm/ and that my login is roberge. This gives me access to a subdirectory called roberge/gdrm and to my site http://www.mus.ulaval.ca/roberge/gdrm/index.htm.

User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio » Fri Aug 22, 2003 4:06 pm

Youll have to keep it this way to make it work on the server...you need to change the directory which you are developing in to have the roberge as part of the directory structure....just add a directory roberge, and move your gdrm into that one.

I use dreamweaver too and edit the site so the local root folder points to the new /roberte/ directory... or create a new one. This way your local site will map exactly the way the server does.
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."

Marc-Andre.Roberge@mus.ul
Super Advanced
Super Advanced
Posts: 47
Joined: Sun May 19, 2002 7:23 pm
Location: Québec, QC, Canada
Contact:

Post by Marc-Andre.Roberge@mus.ul » Fri Aug 22, 2003 5:04 pm

I created a roberge subdirectory where I copied my entire site. I have updated Dreamweaver's settings so that my local site start in d:\roberge\gdrm, which matches the path on the server. I changed my template, using the folder icon to set the reference. The path for the js files now reads:

Code: Select all

<script type="text/javascript" language=JavaScript src="../scripts/milonic_src.js"></script>
<script type="text/javascript" language=JavaScript src="../scripts/menugdrm.js"></script>
This now seems to work, though starting from a different path on my side. I have uploaded my site and things look OK too.

Actually, I found an explanation referring to Dreamweaver users at http://www.milonic.com/menufaq.php#l29.

Finally, there is one thing that is different from my previous version. I used to have a "1" in the editable properties of the menu at the place corresponding to a variable used to "set the overall width of horizontal menu to 100%". My guess is that the "overallwidth" variable (no. 14) in http://www.milonic.com/menuproperties.php is what has to be set. Since there is no explanation besides the variable name, should I conclude that it has not yet been activated? Where exactly does one have to include it? Should it be under "with(menuStyle=new mm_style()){"? And what is the proper format?

overallwidth=100%
overallwidth=1
overallwidth="yes"

Thanks for your friendly help with my problems.

User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio » Fri Aug 22, 2003 6:31 pm

Glad to hear you've got your directories in order. Regarding the overall width, Andy has confirmed it hasn't really been implemented yet. So stay tuned. In the mean time you can add an extra menu item on the end of the menu and set its individual itemwidth property to "100%" and it will make it almost get to the edge.
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."

Post Reply