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

placing the menu in a Dreamweaver template


Poster: nig
Dated: Sunday October 16 2005 - 15:05:30 BST

Before I place the menu in my DW MX template, which would have a big impact on my site http://www.healheadingley.org.uk, I am trying to find out if it would work properly.

At the moment, when I create a new instance of the DW template, I can place the new html page in any subfolder of my site and DW will somehow change the relative links so that all my intra-site links work. Similarly if I move a page from one folder to another - DW alters the relative links.

How will this work with the menu?

I am imagining it won't work, but maybe there's some way. What have other people done?

I am sure DW could manage to get all the links to menu_data.js working properly, from whichever folder I place the html file in. However relative links from menu_data (back to different parts of my site) will not work from some locations in my directory structure, right? This means I would have to only use absolute links in menu_data ......... which means my site would not work off line........ Am I thinking correctly here?

I would like, if possible, to continue to use my site off line, from my own hard drive.

I could have a clumsy work-around by having two menu_data.js files - one for use by files located in the root directory and one for use by files in first level subfolders. However I would need two DW templates to call them and this would intefere with the management of the site when there are changes over time. So I'm not keen.

Any better suggestions? I'm stuck. I can't find this issue referred to in searches of the help files, FAQs etc, though there seem to be lots of other issues to do with relative urls.

Thanks


Poster: bmeine
Dated: Monday October 17 2005 - 19:12:35 BST

Well, I used .net controls to dynamically create mine, but you could create a javascript variable to hold the root of the url.

ex:
var baseurl = "http://www.mysite.com/"; //for live site

or

var baseurl = "http://localhost/"; //for local dev site

Now when creating the menu data just put baseurl at the beginning of each menu item url.

aI("url=" + baseurl + "page.htm;")

Something like that maybe. Haven't tried it, but it should work.


Poster: John
Dated: Tuesday October 18 2005 - 0:00:33 BST

Use server-relative addressing in your menu items (actually, using them everywhere is usually preferable).

Just in case you're not sure, your site is http://www.healheadingley.org.uk/. Assume for a minute all of your menu files are in a directory called /menu/. Your menu calls would then be /menu/milonic_src.js, etc. (note the leading / ).

URLs within the menu itself would be the same - /dir1/dir2/abc.htm, etc. (again note the leading / - it's the key).

What this all means is, regardless of the structure or level of a particular page, the search for a given URL or file will always begin from your base URL; i.e., http://www.healheadingley.org.uk/. So, no more ../../xxx junk, or duplicate files.

Hope this makes sense...

thank you, but......


Poster: nig
Dated: Monday October 24 2005 - 22:28:52 BST

Thank you for these suggestions

I've been trying to set up server-relative addressing as that sounds the most like 'one size fits all'.

It works great on line, but I can't see any menu at all when I am off line.

Please see http://www.milonic.com/forum/viewtopic.php?t=6607