I don't know if this is possible, but I thought I would ask and see.
I would like to pass a variable to a page that contains a menu. This variable would turn the color of one of the menu items to green...so basically setting the oncolor parameter. This would save me having to make a separate menu for each page. The green color on the menu item helps the user to know which page they are on.
Any thoughts on this one?
Thanks
Wendy
Passing menu style parameters to a page
Yes it's possible. I did it and it works.
Here what Andy told me :
Version 5.0 has quite a complex structure and many of the properties can be changed on the fly using the _m() and _mi() arrays.
The only difficult part is getting the reference number of each item or menu.
_m() is the array for menus and _mi() is the array for menu items. Each menu item is numbered from 0 to the number of menu items the menu has. Once you know the item number you can change any of the properties like this.
_mi[20][7]="red" will change the offbgcolor for menu item number 20. You may then need to execute the itemOff function to activate the change, this will be itemOff(20)
There is a full list of each of the menu item properties and the associated number at http://milonic.com/itemproperties.php
We hope to get a much more detailed demo of this posted soon.
Here what Andy told me :
Version 5.0 has quite a complex structure and many of the properties can be changed on the fly using the _m() and _mi() arrays.
The only difficult part is getting the reference number of each item or menu.
_m() is the array for menus and _mi() is the array for menu items. Each menu item is numbered from 0 to the number of menu items the menu has. Once you know the item number you can change any of the properties like this.
_mi[20][7]="red" will change the offbgcolor for menu item number 20. You may then need to execute the itemOff function to activate the change, this will be itemOff(20)
There is a full list of each of the menu item properties and the associated number at http://milonic.com/itemproperties.php
We hope to get a much more detailed demo of this posted soon.
You could also utilize server side scripting. Given a parameter passed in, you could set a variable in ASP called vColor to a certain values, based on the parameter passed in. Then set oncolor to this value. I.e.
Its not that hard if you've used ASP or PHP before. If you dont have such things available to you, your only bet is to go with what topachou mentioned, and get at the menu's innards.
Code: Select all
<%
if( Request("param1") == 1 )
{
vColor = "#00ff00";
}else if( Request("param1") == 2 )
{
vColor = "#ff0000";
}else{
vColor = "#0000ff";
}
%>
then in your menu_data.js file, it would be
....
oncolor = "<%=vColor%>";
....
Dave Hergert
Software Engineer
"Helping to make the menu better, one at a time."
Software Engineer
"Helping to make the menu better, one at a time."
Yes i do it for permissions...
Basically I grab their user ID and then in the menu I say
Its quick and dirty, but its until I get a SQL backend to render it.
Basically I grab their user ID and then in the menu I say
Code: Select all
<%
if( 'adminBob' == Request.ServerVariables('LOGON') )
{
%>
aI("text=protectedStuff;url=....;");
<% }
%>
Dave Hergert
Software Engineer
"Helping to make the menu better, one at a time."
Software Engineer
"Helping to make the menu better, one at a time."