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

Post by gelid »

I took a look at the .NET control demo. It was nice but did not provide the funcitonality that I was look for. I ended up building a few controls of my own and a class library to handle all Milonic menu functions.

1. Yes, the static menu is available to all users. I reference this menu through an js include file, just like all of the samples.
2. Some users will have additional menu items that are custom for each user.
3. The custom items are tailored to the credentials of each user.

- The entire menu is in a database. It can be changed on the fly and the items therefore can be changed in real time.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

I'm sorry to bug you, but I'm trying to understand what you are trying to do.

It seems as if, more or less, you want different menus dependant upon particular conditions.

I found a post I remembered from a long time ago, this isn't the menueditapi, but a person wanted the menu setup based on whether the user was logged in or not, I don't know if this will help or not either.

viewtopic.php?p=13544


I can't figure out how the menueditapi.js module is going to do what you want. You're saying that in effect, if I understand, you want a number of different menus, so you'd have to have different things in the in the menu_data.js file that use the menueditapi.js module to be, inserted, deleted etc. So, I woud think you had to have some way of telling the menu which things to use of those you have listed for the menueditapi.js module based on which conditions. If I'm correct, and I am probably way off base here, I think you'd have to have some kind fo function that sets up and uses whatever the conditions are, kind of like:

Code: Select all

if userIsGen, then do not insert any item, else if userIsLev1, then 
mm_insertItem('Main Menu',2,'text=New Item; else if userIsLev2 mm_insertItem('Main Menu',2,'text=New Item2;') ;  
and so on

How many 'different' menus do you need? Maybe you could set up a function that loads a menu_data.js file based on the particular user, and then each file would have it's own mm_insert/delete/change stuff in it or not in it if that wasn't needed?

I'm just throwing out ideas here, maybe they will give someone an idea, then again maybe they are all wet! :lol:

Ruth
Hubert_Wagner
Beginner
Beginner
Posts: 2
Joined: Wed Jul 09, 2003 4:13 am
Contact:

demo http://www.milonic.com/menueditapi.php does not work

Post by Hubert_Wagner »

The demo at http://milonic.com/menueditapi.php throws an "Object expected" error on line 255 which seems to be "_getDims();" in function mm_createNewMenus() when clicking "Create New Menu".

I'm using IE 6.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

Thank you. I've reported it. Milonic is usually very good and getting things fixed quickly. I'll post back when I know something.


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

Post by Ruth »

Hi

It looks to be fixed. I think :? Not something I use :)

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

Post by gelid »

Where can i get the file that is working? I am still having issues with the file i have.

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

Post by Ruth »

Hi,

I don't know which file you mean. If you mean the menueditapi.js module, then it's at http://milonic.com/menumodules.php You need to go down about 4 or 5 items or so.

If you mean that little demo it's here

http://milonic.com/menueditapi.php

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

Post by les35 »

Ruth wrote:Hi,

I don't know which file you mean. If you mean the menueditapi.js module, then it's at http://milonic.com/menumodules.php You need to go down about 4 or 5 items or so.

If you mean that little demo it's here

http://milonic.com/menueditapi.php

Ruth
Can you look at the code I posted earlier in this thread and tell me why it does not work?
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

I'm sorry, I can't. I'm trying to get some direction from Milonic since I can't get the module to work at all. But, I've always had trouble with it and that is not the module, it is the lack of knowledge on my part.

As soon as I get some information I'll let you know.

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

Post by les35 »

Ruth wrote:I'm sorry, I can't. I'm trying to get some direction from Milonic since I can't get the module to work at all. But, I've always had trouble with it and that is not the module, it is the lack of knowledge on my part.

As soon as I get some information I'll let you know.

Ruth
Thanks Ruth. I'll be eagerly checking this thread. :)
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

Hi,

I have added a new directory to the menu downloads called dynamic_menus.

This is in /extras/dynamic_menus

It is a demo of how to use the Menu Edit Module.

Hope this helps,
Andy
les35
Advanced
Advanced
Posts: 12
Joined: Mon Feb 20, 2006 6:46 pm

Post by les35 »

Andy wrote:Hi,

I have added a new directory to the menu downloads called dynamic_menus.

This is in /extras/dynamic_menus

It is a demo of how to use the Menu Edit Module.

Hope this helps,
Andy
Where is it? I can't find it.
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

Post by Migru »

Hi

you have to log in, then load

http://milonic.com/menuvinfo.php

and download the version 5_746 which is for instance zipped. This contains a folder extras and the subfolder dynamic_menus
Andy wrote:
Hi,
I have added a new directory to the menu downloads called dynamic_menus.


Michael
jttaynton
Beginner
Beginner
Posts: 1
Joined: Mon Jul 17, 2006 11:18 pm

Post by jttaynton »

To go along with the rest of this thread ... we are using mm_insertItem quite extensively. We were having some issues with menus appearing and disappearing with the use of that function but those issues appear to be cleared up using the latest menu build.

Now whenever mm_insertItem is used the menus are displaying on-screen and working fine but each page using that function is throwing a script error:

Error: Object expected

This error appears to trace back to the mm_menueditapi.js function _rbMenus(m) at the line:

if(_gm.style.visibility==$6){

any ideas on what may be causing this? it is happening on any and call pages using the mm_insertItem and the menu files are all the latest available.

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

Post by Andy »

Have you got a URL that we can see?
khendrix
Beginner
Beginner
Posts: 1
Joined: Fri Aug 18, 2006 4:57 pm

Post by khendrix »

some observations on use of the dynamic menu module ... not sure if this will help anyone, but it gave me some problems.

you can pre-create menus and then change them dynamically. at page load time, you could have code like

Code: Select all

with (menuCOSymbols = new menuname("Checkout Symbols")) {
  style=menuStyle;
  alwaysvisible=0;
  aI("text=TEMP;offclass=menuNews");
}

drawMenus();
and then later add menu elements with code like

Code: Select all

mm_insertItem(getMenuByName("Checkout Symbols"), 1, "text=ASDF;url=javascript:menuDeleteCheckoutSymbol('ASDF');offclass=menuNews");
my problems in understanding this were 2-fold ... first, the mm_insertItem() function accepts as it's 1st parameter a menuRef number , not a string like the sample syntax in mm_menueditapi.js. second, if attempting to pre-create a menu as above, the menu MUST have at least one menu item in order to be created by drawMenus() ... hence the "TEMP" aI() function call above.

knowing this has made it simple to maintain 4+ separate dynamic menus on a page simultaneously.
Post Reply