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@gmail.com
Hiding a Menu Item
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
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