Need Help - mm_insertItem - Insert items into existing menu

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
gelid
Advanced
Advanced
Posts: 11
Joined: Fri Dec 30, 2005 3:53 pm

Need Help - mm_insertItem - Insert items into existing menu

Post by gelid »

I am having problems getting the mm_menueditapi.js to work. I have found a sample of how to add a new menu to the page and have succesfully gotten that to work. I need to add additional items into an existing menu.

Here is a sample of what I am doing:
I already have a menu called MainMenu and I use the following to insert an additional item -
mm_insertItem('MainMenu',3,'text=New Order;Status=New Order;url=Shopping/Default.aspx;')

I have put the above statement before and after drawMenus() call without any luck. Does anyone have a sample of this in action?

Any help would be greatly appreciated.
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

Post by Migru »

Hi


there seems to be a sample here:

http://milonic.com/insertitem.htm
though I´m not using it. So sorry no experience in this.

Michael
gelid
Advanced
Advanced
Posts: 11
Joined: Fri Dec 30, 2005 3:53 pm

Post by gelid »

I thought the insertitem was replaced with mm_menueditapi.js. I just tried the insertitem and it did not do anything. It did not give me any errors, but it also failed to insert the item into the menu. Any other ideas?
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

Post by Migru »

Hi

I´m sorry there is something wrong with this link/result

http://milonic.com/insertitem.htm

the zip file there contains the source

http://milonic.com/insertitem.htm which targets to

http://milonic.com/insertitem.htm

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! MILONIC HELP !!!!!!!!!!!!!!!!!!!!!!!!!!!! PLEASE


Michael
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi Michael,

The insertitem module was a demonstration put together for someone a long time ago, as it developed it became the menueditapi.js module which has that included in it. I believe that is still up just in case there is anyone still using an old version 5 level and it won't work with the newer releases.

Ruth
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

Post by Migru »

Hi Ruth

When posts ask for help, first thing I do is I´m looking for sample pages. That is why I came across that link.
I wasn´t aware too, that syntax is included in this menueditapi.js file.
Thanks

Michael
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi Michael,

How's it going? That menueditapi.js module is supposed to let you, insert an item, delete an item, edit an item. I've never been able to get it to work right, and I know others have, so I have to be doing some dumb thing. Anyway, I have links to when this was originally done if you want to take a look

viewtopic.php?p=22896

viewtopic.php?t=5451

Ruth
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

Heres a demo I've just published to show how to add, edit and delete stuff:

http://milonic.com/menueditapi.php

Hope this helps,.
Andy
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Terrific, Andy!

This is great.

Ruth
gelid
Advanced
Advanced
Posts: 11
Joined: Fri Dec 30, 2005 3:53 pm

Doing something wrong

Post by gelid »

I obviously still doing something wrong. Here is my code.

Main Static Menu w/ style:

with(MainMenuStyle=new mm_style()){
styleid="1";
styledescription="MainMenuStyle";
bordercolor="#8A867A";
borderstyle="solid";
borderwidth="1";
fontfamily="Tahoma,Helvetica,Verdana";
fontsize="9pt";
fontstyle="normal";
fontweight="normal";
imagepadding="0";
menubgcolor="#9d5022";
offbgcolor="#b7bb98";
offcolor="#000000";
onbgcolor="#f3f8cb";
onborder="1px solid #515340";
oncolor="#000000";
overfilter="Fade(duration=0.2);Alpha(opacity=90);Shadow(color=#b4b989', Direction=135, Strength=1)";
padding="3";
separatoralign="right";
separatorcolor="#afb484";
separatorpadding="1";
subimage="" + HOME_DIRECTORY + "Library/Menu/arrow.gif";
subimagepadding="3";
menualign="center";
}


with(ExtranetMainMenu=new menuname("ExtranetMainMenu")){
styleid="1";
optiondescription="Main Menu Option";
alwaysvisible="1";
top="93";
orientation="horizontal";
menualign="center";
menuwidth="800";
alignment="left";
screenposition="center";
style=MainMenuStyle;
aI("status=Welcome;text=Home;url=" + HOME_DIRECTORY + "default/;")
aI("status=Profile;showmenu=Menu_3;text=Profile;")
aI("status=My Orders;showmenu=Menu_7;text=My Orders;")
aI("status=Customers;showmenu=Menu_26;text=Customers;")
aI("status=Tasks;showmenu=Menu_24;text=Tasks;")
aI("status=Logout;text=Logout;url=" + HOME_DIRECTORY + "Authenticate/Logout.aspx;")
}

Insert Item Code:
mm_insertItem('ExtranetMainMenu',31,'text=Shopping;Status=Shopping;url=Shopping/Authenticate/Login.aspx;')

The code runs but it actually makes allt he stic items disappear. It looks like the items are actually hiding under the background color of the menu, at least that is what it appears to do.

Any thoughts on how to get to work? This should be simple. I have a static menu to which I need to add dynamic items. These items do not even have to be added using any sort of button but rather will just be put on the page on load. Any help would greatly be appreciated.
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

Post by Migru »

Hi

could not get your "main static Menu w/style" in operation.
I´m sorry had no time to check your syntax, but it did not work.
Can´t you provide a url?


Michael
gelid
Advanced
Advanced
Posts: 11
Joined: Fri Dec 30, 2005 3:53 pm

Post by gelid »

here is a link http://www.infinitumpro.net/site/default.htm to a sample of what I am trying to do. The file is not pretty because I had to remove all of the info my companies internal info, but the page is functional as is. You will notice I have some javascript commented out in the html, uncomment the code to see what i am talkign about.

Thanks for all your help.

Shawn
les35
Advanced
Advanced
Posts: 12
Joined: Mon Feb 20, 2006 6:46 pm

Post by les35 »

I too am having a lot of trouble getting mm_insertItem() to work.

I have uploaded a test page showing what I have (and I'll also include the code below in this post)

This page shows the code with the mm_insertItem()
http://www.esaba.com/menutest/with_insert.html

This page shows the same code with mm_insertItem() commented out
http://www.esaba.com/menutest/without_insert.html

You can find all the files used here:
http://www.esaba.com/menutest/

What am I doing wrong?


In menu_data.js i have:

Code: Select all


fixMozillaZIndex=true; //Fixes Z-Index problem  with Mozilla browsers but causes odd scrolling problem, toggle to see if it helps
_menuCloseDelay=500;
_menuOpenDelay=250;
_subOffsetTop=2;
_subOffsetLeft=-2;

forgetClickValue="true";

with(menuStyle=new mm_style()){
bordercolor="#000088";
borderstyle="solid";
borderwidth=1;
fontfamily="arial, tahoma";
fontsize=14;
fontstyle="normal";
headerbgcolor="#AFD1B5";
headercolor="#000099";
offbgcolor="transparent";
offcolor="#000000";
onbgcolor="#FEFAD2";
oncolor="#000000";
outfilter="Fade(duration=0.1);Alpha(opacity=95);Shadow(color=#777777', Direction=135, Strength=3)";
overfilter="Fade(duration=0.1);Alpha(opacity=95);Shadow(color=#777777', Direction=135, Strength=3)";
padding=3;
pagebgcolor="#e5ecf9";
pagecolor="#000066";
separatorcolor="#000088";
styleid=1;
headerborder=1;
imagepadding=3;
onborder="1px solid #000088";
separatoralign="right";
separatorpadding=1;
separatorwidth="85%";
valign="middle";
menubgcolor="#e5ecf9";
keepalive=1;
openonclick=1;
}

with(top=new menuname("Main")){
screenposition="center";
alwaysvisible=1;
orientation="horizontal";
style=menuStyle;
top=100;
aI("showmenu=Open;text=Open;");
}

with(bottom=new menuname("Open")){
screenposition="center";
orientation="horizontal";
style=menuStyle;
margin=2;
aI("text=Hello;url=something.html;");
}

drawMenus();

In my html I have:

Code: Select all

<html>

<head>
<script type="text/javascript">
function startCheck()
{
	mm_insertItem('Main',1,'text=NewItem;url=test.html;');
}
</script>
</head>

<body onLoad="startCheck();">
<a href="https://milonic.com/">JavaScript DHTML Drop Down Menu By Milonic</a>
<script type="text/javascript" src="milonic_src.js"></script>
<script type="text/javascript" src="mm_menueditapi.js"></script>
<script type="text/javascript">
if(ns4)_d.write("<scr"+"ipt type=text/javascript src=mmenuns4.js><\/scr"+"ipt>");
  else _d.write("<scr"+"ipt type=text/javascript src=mmenudom.js><\/scr"+"ipt>");
</script>
<script type="text/javascript" src="menu_data.js"></script>
</body>

</html>

If I comment out the mm_insertItem() call, the menu displays fine.
If I leave the mm_insertItem call in, the menu doesn't show.
Hubert_Wagner
Beginner
Beginner
Posts: 2
Joined: Wed Jul 09, 2003 4:13 am
Contact:

mm_menueditapi.js function _incItem(_aI) renamed to f_(_aI)

Post by Hubert_Wagner »

I had the same problem until I edited the function mm_insertItem in mm_menueditapi.js
I commented out this line:

Code: Select all

// _incItem(_aI);
and replaced it with this line:

Code: Select all

f_(_aI);
les35
Advanced
Advanced
Posts: 12
Joined: Mon Feb 20, 2006 6:46 pm

Re: mm_menueditapi.js function _incItem(_aI) renamed to f_(_

Post by les35 »

Hubert_Wagner wrote:I had the same problem until I edited the function mm_insertItem in mm_menueditapi.js
I commented out this line:

Code: Select all

// _incItem(_aI);
and replaced it with this line:

Code: Select all

f_(_aI);
That's weird. I just checked my mm_menueditapi.js file, and the "_incItem(_aI)" line was already changed to "f_(_aI)"

There seems to be different versions of mm_menueditapi.js hosted on milonic.com

Could you please upload your mm_menueditapi.js and post a link so I can try it.
gelid
Advanced
Advanced
Posts: 11
Joined: Fri Dec 30, 2005 3:53 pm

Post by gelid »

I get an error using either one of those lines. I would also like to see the version that is working.

Is anyone trying to do this on page load? I am trying to add menu items on page load; meaning I am not using any type of button click or anything to create the menu as is done in the sample.

Any help would be greatly appreciated.
les35
Advanced
Advanced
Posts: 12
Joined: Mon Feb 20, 2006 6:46 pm

Post by les35 »

gelid wrote:I get an error using either one of those lines. I would also like to see the version that is working.

Is anyone trying to do this on page load? I am trying to add menu items on page load; meaning I am not using any type of button click or anything to create the menu as is done in the sample.

Any help would be greatly appreciated.
I am also looking to use this on page load. Specifically, I want to use information stored in a cookie to determine which menu items load and which don't.

I'm surprised this issue is taking so long to resolve. Normally, I would have given up on Milonic long ago and went with one of the many other menu options available. However I have other projects with priority over the one using the milonic menu, so I can put the milonic menu project on the back burner until this issue is resolved.
Last edited by les35 on Wed Mar 22, 2006 2:26 pm, edited 1 time in total.
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

Post by Migru »

Hi
I´m wondering, really,
theres a sample (see above) to demonstrate how it works.
And there still seems to exist some contradiction or confusion about the way to implement it.
What is the issue and what is to resolve?
So, if you have a real problem (and a license) why don´t you send a formal request to Milonic?
I´m not using this function (at present), so can´t help, no experience on this at all. Sorry.

Michael
gelid
Advanced
Advanced
Posts: 11
Joined: Fri Dec 30, 2005 3:53 pm

Post by gelid »

I have submitted it to Milonic support as well. I am posting in the forums because support has not been able to resolve it yet.

Here is what I am trying to do.

I have a standard menu filled with static menu items. I also have several dynamic items what will be added tot he menu based on the type of user logged in. To do this, I want to add the items on page load. I want to do this just by writing out a session variable I hold for each user. All of my development is in ASP.NET, but I do not think this has anything to do with the issues I am having.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

I wanted to post this link, just in case it had anything to help. I know it's not to do with the mm_menueditapi.js module, but you mentioned the asp.net thingee and this has to do with that. The link goes to the post with the demo links in it. It probably doesn't have anything to do with what you want.

viewtopic. ... 7360#27360

Noting that this is beyond my knowledge level, if I understand correctly:
1. you want all 'general' users to have a particular 'static' menu,
2. other users are to have additional 'menus or items, and finally,
3. the other users are divided into different groups so there is a distinction between these users and they need different menus or items based on a particular log-in.

Is this correct? And, in addition, do these menus that are loaded based on login have to be dynamic because they 'change' by day, or dept or something?

Ruth
Post Reply