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

sub directories


Poster: noel dubau
Dated: Sunday January 4 2004 - 6:47:49 GMT

Excuse my approximative english !
The problem is the following one : In the directory of my site are many sub directories ; must I put in every one all the .js files ? Or is there a syntax to say that tje .js files are in a directory above the current one ?
Thanks for your help.
Noël


Poster: Hergio
Dated: Sunday January 4 2004 - 18:46:29 GMT

Yes it can be done and should be done that way. That way you have one copy of the menu and all the pages use it, so when you make a change, all the menus "see" it.

Basically when you say src="" in your menu includes, put the address of the menu code in there, and include your server address. (i.e. http://www.yourdomain.com/menucode/mmenudom.js) that way no matter what page is using the menu code, you can get to it. See this little post that John put some effort into to explain some addressing issues. For further help, do a search on the forums for "addressing" and "path" or "relative" and "absolute".

http://www.milonic.com/forum/viewtopic.php?t=1983

Re: sub directories


Poster: timrivera
Dated: Sunday January 4 2004 - 19:32:48 GMT

noel dubau wrote:
must I put in every one all the .js files ? Or is there a syntax to say that tje .js files are in a directory above the current one ?


You don't have to include the full URL as Hergio suggested, just make reference relative to the root directory, i.e. src="/menu/*.js". Or if all the .js files are just one directory above all the pages that will use the menu, you can write the reference as src="../menu/*.js".

One important note is that the arrow images must also have a relative path defined from the page that uses the menu. I am about to use the menu on various directory levels, therefore I define the location of the .js files relative to the root directory, and in the menu_data.js and mmenuns4.js files I also define the location of the arrow images relative to the root.


Tim

Re: sub directories


Poster: John
Dated: Sunday January 4 2004 - 20:28:56 GMT

timrivera wrote:
Or if all the .js files are just one directory above all the pages that will use the menu, you can write the reference as src="../menu/*.js".

Not a good idea, especially if the site goes more than one level deep. Then you wind up with ../../menu, ../../../menu, etc. Server relative is the best way to go.

Re: sub directories


Poster: timrivera
Dated: Sunday January 4 2004 - 21:32:14 GMT

jgillett wrote:
Not a good idea, especially if the site goes more than one level deep.


That's why I said "if all the .js files are just one directory above" in response to the original question of "Or is there a syntax to say that the .js files are in a directory above the current one ?"

Oh, and all the links in the menu have to be relative to the root also (or absolute).

Re: sub directories


Poster: John
Dated: Monday January 5 2004 - 3:39:53 GMT

timrivera wrote:
That's why I said "if all the .js files are just one directory above" in response to the original question of "Or is there a syntax to say that the .js files are in a directory above the current one ?"

Hmmm - sorry, missed that small detail.
timrivera wrote:
Oh, and all the links in the menu have to be relative to the root also (or absolute).

Absolutely :!: :roll:


Poster: noel dubau
Dated: Monday January 5 2004 - 7:36:52 GMT

Thanks a lot to everyone !
I'm going to try your methods to see what is the better one ! In french we have a proverd saying "The best way is that which gives the result you hope !"
Sincerely,
Noël


Poster: John
Dated: Monday January 5 2004 - 14:55:22 GMT

Please let us know what happens.