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: Archived Topics for the old Version 3.0 JavaScript Menu
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:15

Menu problems on subsequent pages within folders


Poster: JBaumwirt
Dated: Sunday August 31 2003 - 20:13:02 BST

The page I am constructing for a public high school is rather complex in that it requires a series of nested folders with both .doc files, .pdf files as well as .htm files.

It was my intention to have the same menu bar appear on all htm pages
throughout the website and I do not wish to use frames. While the menu bar works from the intial opening page, when I cut and paste the script to other htm pages the bar shows up but I am unable to navagate to the other pages from the bar (pages are not found).

It appears to not recognize the links to the pages other than from the main page. I tried going back into menu_array and entering full URL addresses for each and every button link but that just destroyed even the main page navagational bar. Is it not possible to have a folder system within my webpage with htm pages organized inside that still have the same active menu bar?

Thanks for any assistance here.


Poster: Ruth
Dated: Sunday August 31 2003 - 22:05:50 BST

Do you have a link? It would be easier to see what it's doing.
:)
Ruth

Pages within folders not recognized by menu bar


Poster: JBaumwirt
Dated: Monday September 1 2003 - 8:42:20 BST

You can check the dummy page that I've been playing with at http://www.jozie.net/JF/Charter

I cannot access the school page from anywhere except school for any changes...so I set this up to be able to adjust and see the result as this has FP extensions enabled.

Thanks.

Judie


Poster: Ruth
Dated: Monday September 1 2003 - 14:29:12 BST

Well, I tried the site. As far as the .doc extensions, they must work since I could get the ethicspolicystatement.doc when I clicked the link. The others that were in the http://www.jozie.net/JF/Charter/charter wouldn't come up at all, not even the .htm pages. I dont' really know anything about nested folders and such, but have you tried putting in the full url and see if them work, just to check that?

Ruth


Poster: Hergio
Dated: Monday September 1 2003 - 18:42:56 BST

Yes JBaumwirt the menu does support directory structures that can get complex, but you just have to make sure you know where you are referencing files from. It looks like in your URLs, you are referencing relatively and that means that your urls means different things depending on which page they are on. Here a quick lesson on URLs,

dir1/dir2/page.asp - means whatever directory the page that is currently being viewed is in, it will look for a sub directory called dir1, then in that, look for dir2, and then in that, look for page.asp. So if you were viewing a page inside of dir2, this wouldnt work since there is no dir1 inside of dir2.

../dir1/page.asp - go up one directory from the page I am currently viewing and then look in that directory for a dir1, and then in that for a page.asp.

/dir1/dir2/page.asp - Go to the ROOT of the site and start from there, looking for a dir1 then a dir2, then page inside of that. This is called absolute URL because no matter what page you put this in on your site, it ALWAYS means the same thing. This should be how you link to all your pages since will be using the menu on multiple pages on multiple directories.

Menu bar


Poster: JBaumwirt
Dated: Monday September 1 2003 - 19:08:04 BST

Dave,
No question you know what you're talking about but could you bring it down a few notches and possible give me an example because I have no idea what you said. My Chemistry degree doesn't prepare me for this stuff.

I was under the impression that once the menu_array is set up to find the folders as it is on the main opening page it would work on each htm page if I cut and pasted the two liner script on the bottom (within the body) of each htm page. That didn't bring up the menu bar at the top of the subsequent pages so I copied and pasted the menu-array to each folder that the htm pages were in. This brought up the menu bar on the htm pages but the relativeity to the links was lost (page not found). Do I have to rewrite the menu-array for each folder so that it is relative to each page within that folder??? There are basically going to be 6 directories...each needs it's on menu array relative to the folder location?

I did try typing in the full URLs of each of the htm's including their subdirectories to insure that the pages would be found relatively but instead of working on all the pages the entire bar was lost...even on the main page.

Think DUMB and illiterate when you respond please. 8O

Judie

For Ruth - Menu bar lost in space


Poster: JBaumwirt
Dated: Monday September 1 2003 - 19:13:10 BST

Ruth I did try putting in the full URL but then the whole menu died...

I have 5-6 directories inside the web. The .doc's and .pdf's seem easily found but NOT the htm's except from the main page. Once you are inside one of the folders it can't find the other htm pages inside other folders and you get "file not found." EXAMPLE If you start at the main page go to ABOUT US ...ACCREDITATION from there you can't go to ABOUT US ...SCHOOLWIDE EXPECTED... it doesn't find the other htm page even though it's in the same directory??

Any other suggestions?

Judie

Menu Bar again - For Dave


Poster: JBaumwirt
Dated: Monday September 1 2003 - 19:43:58 BST

Dave, reading very carefully your lesson on URLs if I can write this absolute URL I do have a question about relationships. Is directory 1 considered my main web folder where my index page is found and each of the subdirectories considered directory 2, 3, 4...etc? Should I rename all my directories to numbers? What does .asp mean? Just trying to make sense of this...I'm sure I sound like an idiot but this sounds like what I tried to do by entering the full URL's beginning with http:// for each of htm pages in the menu_array but they still couldn't find the other htm pages...in fact the menu disappeared completely.


Judie


Poster: Hergio
Dated: Monday September 1 2003 - 19:56:54 BST

asp is just a type of file, just like htm or doc, i used it just for example...dont worry about it. dir1 and dir2 were used to just show the relationship between directories, and that dir2 was inside of dir1. Dont rename your folders, its fine how you have it.

In all your URLs in the menu, do it like this. I am assuming ALL your files are in the JF/Charter directory...like I mean, under Charter is AboutUs directory and Departments directory...right?
All your URLs should start EXACTLY like this (if everything is in your charter directory)
/JF/Charter/index.htm
/JF/Charter/Aboutus/about.htm
/JF/Charter/Departments/index.htm

Do you see, here, it says look in the root directoey (not necessarily where index is) and start from there, go into JF, into Charter, and so on. And when you include your files in the page using the <SCRIPT> tags, make sure you say src="/JF/Charter/menu_array.js" so it looks in the same spot no matter what page you include the menu into.

Menu problems


Poster: JBaumwirt
Dated: Tuesday September 2 2003 - 7:55:47 BST

Dear Dave,
Thank you...you speak my language here. I will redo it and try again. I do have a bit of a problem with the "root" directory as the STUDID archaic school server continues to cause me grief. I only have that mirror site up at jozie.net that you were reviewing to play with as Front Page Extensions are enabled there and I can edit online but not on the school server as I have to FTP up everything onsite.(a real pain)

Can I consider the root directory where the index page and the menu_array file and other menu files are found? All else with few exceptions are found within other folders. I'll give it a shot tomorrow at school and see if they fire me.

Thanks so much for your patience with me. I truly appreciate your help.

Judie


Poster: Hergio
Dated: Tuesday September 2 2003 - 13:47:33 BST

No you cannot assume your root directory is where your index file is, because the address you gave me was jozie.net.com/JF/Charter/ which means that your index file is not in the root directory. If it was, it the address for the page would just be jozie.net/. So this means you have to append all your URLs with /JF/Charter/ and then whatever filenames or folder names are located inside of Charter/. (Note the / in front of JF, its important)
If you have other pages in other folders that are NEXT to Charter (they are at the same level as Charter, not inside of it), then you would link to those directories as so... /JF/OtherDirectoryName/.

Hey, glad I am able to help you. This all will become second nature to you with practice. :)

Menu Problems


Poster: JBaumwirt
Dated: Tuesday September 2 2003 - 14:44:13 BST

The problem i I don't know what the full root directory is for the webpage on the school server. I know where I upload it but that isn't enough because I know that it is inside of some folder that I can't see. I will see if I can get this information out of the network manager who knows nothing about webpages. We are running blind on this one.

More later.

J


Poster: Hergio
Dated: Tuesday September 2 2003 - 15:41:47 BST

YOu can find it out by yourself. When you visit the page in a browser, whatever the address is in the address bar will answer that. When you go to the homepage and it says....www.domain.net/JF/Charter/ that means the root begins at the .net and JF is a directory in the root...so you can just use /JF/Charter/ in your URLs. If someone gives me a site called http://www.mydomain.com/newSite/ver2/ then I Know that if they want to link to another page on their site, they can just have their urls say url=/newSite/ver2/somepage.htm;

got it?


Poster: John
Dated: Tuesday September 2 2003 - 20:19:03 BST

One other general point to watch for. You mentioned FrontPage, and that sends great shivers up and down my spine. Be very careful when working with that "program", as it can do things to your code behind your back that messes everything up and takes forever to find.

Menu Bar and program glitches


Poster: JBaumwirt
Dated: Wednesday September 3 2003 - 7:48:40 BST

Thank you all for all this excellent assistance!

While the information about Front Page is noted, are there similar problems with Dreamweaver? I am considering this as the program utilized by the entire school for future pages.

Judie

Menu Bar and URLS


Poster: JBaumwirt
Dated: Wednesday September 3 2003 - 7:57:58 BST

Dave,
In this particular case finding the URL is not all that simple. As a public school we are required to go through the School District's server for firewalls and other security services (not that it works...because all it does is slow is down). When you type in the url and go to the page the real url is displayed only on a bottom bar. I went in and had the network administrator trace the website on our own server and found that there is an addition hidden folder that doesn't show up anywhere else. I will have to experiment to see if that folder needs to be part of the root description or not. Sheesh...

Judie

Re: Menu Bar and program glitches


Poster: John
Dated: Wednesday September 3 2003 - 15:27:29 BST

JBaumwirt wrote:
While the information about Front Page is noted, are there similar problems with Dreamweaver? I am considering this as the program utilized by the entire school for future pages.

You couldn't pick a better program :!: And no, there are no problems like that with DW. Since you are a school, definitely go for what is now renamed as Macromedia MX 2004 - Dreamweaver MX, Fireworks MX, Flash MX, FreeHand MX, and, if you get the Win version, ColdFusion MX 6.1 as well all in one package. All that at a STEEP discount from retail.

It's supposed to ship mid-September. They're taking pre-orders now, but not for the educational version yet. See http://affiliates.macromedia.com/b.asp?id=1929&p=go/dr_home_aff1 and click on the Student & Teacher Discounts in the right column. Keep an eye out there for the edu release.

Menu bar and Directory glitches


Poster: JBaumwirt
Dated: Thursday September 4 2003 - 8:42:52 BST

Dear Dave et all,
Thanks so much for all your help...after only 200 hours I finally figured out how to get the menu_array to reference the correct directory and the correct page. Oddly enough it wasn't quite what I expected but now I feel like I'm leveling out a bit on that extremely steep learning curve...

What works came from looking at the backslash arrangements you provided and meticulously long trial and error. Just because I am still boggled that it finally is straightened out, I will attempt to describe what worked so you can tell me WHY....

The basic menu has 8 buttons and eight directories (folders) with htm, doc and pdf files inside each. The index file, menu_array file and other two required files along with the arrow graphics are outside of the 8 directories in the root directory. Several menu buttons have subcategories under the buttons, some have a second level to choose from. The menu_array only worked when I put a forward slash before the main (8) directory names then went back in and wrote out the entire URL (including http...) under each of the subcategories or sub-sub-categories for each htm page. This was the only way the htm pages in one directory could find the htm pages in another directory regardless of their positioning on the menu bar arrangement or the directory/file structure.

I additionally had to add a forward slash in front of menu_array in the script file that was copied to each of the htm pages regardless of their location in the web for them to find the menu in the root directory. There is no forward slash on the script that is actually on the main opening page which is located in the root directory along with the menu_array file.

Finally, I had to go back into the menu_array file and add a forward slash in front of the /arrow.gif and /affordn.gif so that each page's menu bar could find the graphics located in the root directory.

It was a bear...but it WORKS! I still don't understand why the main directories don't need the full URL...but need the forward slash in front of the directory name/file.htm

With this I'm going to sleep for a WEEK! YIPPEE!

Judie

Making the menu work...one line at a time! http://www.granadahillshighschool.com


Poster: bobwill
Dated: Friday September 12 2003 - 14:31:04 BST

I just wanted to respond about the "relative' vs "absolute" directory issue. I have never been able to get the "absolute" directory to work. I cannot even get it to work when trying to load the "index" file on the server that I have been using. One of the issues that may be a problem is that I develop all my code on my PC and then FTP the files to the server. My url is "www.baseball.legion.org", however when I FTP the files the directory structure where the files reside on the server is "/home/Clients/baseball/public_html". If I include the "JS" files using <SCRIPT language=JavaScript src="javascripts/milonic_src.js" type=text/javascript></SCRIPT> and the scriptpath="javascript/"; the "index" file loads the menu just fine. If I place a leading slash on the "javascript" directory the menu does not load. Once I called a "htm" file in a sub-directory then the menu does not load. I had to set the scriptpath to the full URL.
scriptpath="http://www.baseball.legion.org/javascirpts/"; and leave the includes as relative. I hope some of this makes sense. I also have to define a variable which I called "baseurl" set to "http://www.baseball.legion.org" and and add it to the url addressing within the men_data.js file. Example:aI("text=WS Pairings;url="+baseurl+"2003/wspairings2003.htm;status=2003 Pairings;separatorsize=1")

I would like to make this a much cleaner menu system eliminating all this "DIRECT" addressing, but the I cannot get "ABSOLUTE" to work.

Can you give me advice on what to try.


Poster: Hergio
Dated: Friday September 12 2003 - 16:46:28 BST

It looks like your directory structures on your home machine are different from your server directory structure. If you want to get rid of some problems (so your code works on both home and server) you need to mimic the server directory structure on your home machine.

Judging from the looks of your directory set up you may not be able to use absolute addressing. THe reason being, you are being hosted on somebody elses server and they have their directories set up in such a way that your entire domain is a virtual directory so I am unsure how the server goes about mapping things that are technically in YOUR root, but not on the server's actual root.

absolute URL


Poster: JBaumwirt
Dated: Saturday September 13 2003 - 5:54:11 BST

It appears I have the same problem as the school website has to go through the district server...so this is why I couldn't get any recognition for absolute ... I'm just grateful it's working so well despite it's length!

Thank you all so much for your help


Poster: John
Dated: Monday September 15 2003 - 14:57:50 BST

Great :!: Another satisfied customer :)

Glad it's working.