Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mm_menu.js location

Status
Not open for further replies.

donmynack

Programmer
Apr 1, 2004
1
US
Hello All,
I am new to this forum and I hope somebody can help me out with this.

A client has a requirement that I use the Dreamweaver Pop-Up Menu system for a site. They want it to be editable using DWMX.

Anyway, this is a large site with 1000+ pages, so I want this nav system, including the DW pop-up menu, to be a single include file across the site. For the links, I am using links relative to the root, i.e. /tester/thisdir/thispage.htm, with tester being the root folder of the site. I have a directory in the root of tester that holds the nav.htm page, and the mm_menu.js page.

If I use the include in a sub-directory, the mm_menu.js file is not found since the link to it is no longer correct, i.e.

<script language="JavaScript" src="mm_menu.js"></script>

is not valid since that path to the .js file doesn't work anymore. No problem, I thought, I'll just make that link realtive from the root to, i.e. like so:

<script language="JavaScript" src="/includes/mm_menu.js"></script>

Viola! This enables the menu system to work properly.

The problem comes in here - if I want to edit the menu, using the "show pop-up menu" dialog wizard thing, it can no longer find the mm_menu.js file, and inserts another reference to it like so:

<script language="JavaScript" src="mm_menu.js"></script>

It also cannot find any of the menu items I previously created, and prompts me to create all new ones, even though the old ones are still on the page, so I get a mess of code like this:

<script language="JavaScript">
<!--
function mmLoadMenus() {
if (window.mm_menu_0401112113_0) return;
window.mm_menu_0401112113_0 = new Menu("root",101,20,"Verdana, Arial, Helvetica, sans-serif",14,"#0000ff","#0000ff","#ffffff","#999999","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
mm_menu_0401112113_0.addMenuItem("New&nbsp;Item&nbsp;3");
mm_menu_0401112113_0.addMenuItem("New&nbsp;Item&nbsp;2");
mm_menu_0401112113_0.addMenuItem("New&nbsp;Item&nbsp;1");
mm_menu_0401112113_0.hideOnMouseOut=true;
mm_menu_0401112113_0.bgColor='#ffffff';
mm_menu_0401112113_0.menuBorder=1;
mm_menu_0401112113_0.menuLiteBgColor='#ffffff';
mm_menu_0401112113_0.menuBorderBgColor='#ff0000';

mm_menu_0401112113_0.writeMenus();
} // mmLoadMenus()
//-->
</script>
<script language="JavaScript" src="/rtstock/mm_menu.js"></script>
<script language="JavaScript1.2">mmLoadMenus();</script>
<script language="JavaScript">
<!--
function mmLoadMenus() {
if (window.mm_menu_0401112113_0) return;
window.mm_menu_0401112113_0 = new Menu("root",89,20,"Verdana, Arial, Helvetica, sans-serif",14,"#0000ff","#0000ff","#ffffff","#999999","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
mm_menu_0401112113_0.addMenuItem("New&nbsp;Item");
mm_menu_0401112113_0.hideOnMouseOut=true;
mm_menu_0401112113_0.bgColor='#ffffff';
mm_menu_0401112113_0.menuBorder=1;
mm_menu_0401112113_0.menuLiteBgColor='#ffffff';
mm_menu_0401112113_0.menuBorderBgColor='#ff0000';

mm_menu_0401112113_0.writeMenus();
} // mmLoadMenus()
//-->
</script>
<script language="JavaScript" src="mm_menu.js"></script>
<script language="JavaScript1.2">mmLoadMenus();</script>

As you can see, same id, it just can't seem to change the internal reference it stores the mm_menu.js unless I use a realative link like "../rtstock/mm_menu.js", which of course will break the include throughout the site! Any suggestions here - remember, the client requires that I use this!

Thanks.
 
Hi donmynack!
solution is far from perfect:
edit your "relative to root path" to what DW likes=NO subfolders...it is just one of those things when u use Inlcudes as the DW interface likes to place it in the 'same directory as the page'. so...bad news.
They (MM_people) could have accounted for this but then the issue comes about "which_folder/mmmenu.js". You will also find issues with display of "Show-Pop up menu".....
read some more on:

Now, does your

U could edit your DW XML so it interprts its subfolders in mind...however you would have to do this to every machine that will edit this file with DW.....time for an extention ;-)?

===========================================================

How about an Alternative?
People seem to really like this "menu" that is Buitin in DW but I personally think that "ease of use" is missleading.
Why?
Editing and handeling JS files can and is a pain so I always suggest to swtich to a "easier" menu system that can be powerd by DW builtin JS functions....
it is easier to customise as well as combine with CSS navigation
HTML: along with CSS: or using images as shown in tutorial.....

it is very easy to edit and all u are handleing are Show/hide layer behaviors and a few layers.....notice that JS will sit above head tag like ususal and is easily editable and it is not neede to be "included"
HTH
All the best!

> need more info?
:: don't click HERE ::
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top