Sothink DHTMLMenu, Version 7

Using Web Paths

Under Global Settings - Web Path, the DHTMLMenu program allows you to enter a path for menu scripts and images. We recommend using a URL for both script and image paths. For example, if your site is located in the root directory of yourdomain.com and the menu files are located in a subdirectory/folder named "menu", the URL for both script and image paths would be:

http://www.yourdomain.com/menu/

That should work no matter how many levels your site might have. It is true that you would have to update the URL if you moved your site to another domain, but that should happen very rarely.

If you try to use a relative path for script and image files, it's easy to run into trouble. Some people have trouble using relative paths correctly and, even if you insert the correct relative path, the menu won't work in a site with multiple levels. Let's use the same example of yourdomain.com with the menu files located in a subdirectory/folder named "menu", but let's assume that the site has multiple levels. Within the root directory there is a subdirectory/folder named "members", and within "members" there is a subdirectory/folder named "downloads". You enter the following relative path for script and image files (notice that there is a trailing slash but no leading slash) :

menu/

The menu will be displayed in pages in the root directory, but the menu will not appear in pages in the "members" subdirectory or the "members/downloads" subdirectory. That is because the relative path changes depending on the level. For the "members" subdirectory the correct relative path would be:

../menu/

and for the "members/downloads" subdirectory the correct relative path would be:

../../menu/

The moral of this story is: use a URL for both script and image paths and save yourself a lot of headaches.

 


Copyright © 2007, William S. Pitt