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

Hiding a Menu Item


Poster: pakaymc
Dated: Thursday July 5 2007 - 17:30:46 BST

Hiding a Menu Item

Is it possible to hide/unhide a Menu Item based on a value stored in a MySQL table?
As an example. If my menu is as follows
aI("text=Home;url=../Home.php");
aI("text=LogOff;url=../LogOff.php ");
aI("text=Show;url=../Show.php");
aI("text=Hide;url=../Hide.php");

In my MySQL table I have a field ShowHide with a value of Y or N.
If the value = Y this will be my menu:
aI("text=Home;url=../Home.php");
aI("text=LogOff;url=../LogOff.php ");
aI("text=Show;url=../Show.php");
aI("text=Hide;url=../Hide.php");

If the value = N this will be my menu
aI("text=Home;url=../Home.php");
aI("text=LogOff;url=../LogOff.php ");
aI("text=Show;url=../Show.php");

As you can see I removed aI("text=Hide;url=../Hide.php");

I read the table with php and store the value of ShowHide in $mShowHide.
Can I use an if statement such as:
If ($mShowHide == ā€œNā€) {
aI("text=Home;url=../Home.php");
aI("text=LogOff;url=../LogOff.php ");
aI("text=Show;url=../Show.php");
aI("text=Hide;url=../Hide.php");
} else {
aI("text=Home;url=../Home.php");
aI("text=LogOff;url=../LogOff.php ");
aI("text=Show;url=../Show.php");
}

Any help and ideas will be appreciated.

Michael Pakay
pakaymc __at__ gmail.com


Poster: Ruth
Dated: Friday July 6 2007 - 0:49:56 BST

Hi,

I think you need to take a look at the menueditapi.js module. I believe there is a sample in the download. I'm sure it can be done, but I do not know how to do such advanced things. I know people have menus set up which show x if logged in and don't show it if not logged in. Not sure how they do that, probably with some kind of js code. You might have to contact Milonic for help with this if you have a professional or above menu with a current support contract.

Ruth