I have a menu item with a number but I need to hide some depending on a global variable if the variable is 1 to show me some example
if (variable_global == 1)
{
here should hide item
}
else
{
item
}
I have a menu item with a number but I need to hide some depending on a global variable if the variable is 1 to show me some example
if (variable_global == 1)
{
here should hide item
}
else
{
item
}
Re: hide item
using s_c’s dynamic menu example you could place the sc_appmenu_add_item() inside an if:
S_C’s code
foreach ({dsmenu} as $arr_menu){
$id_item = ‘item_’.$arr_menu[0];
if($arr_menu[1] == 0){
$id_parent = '';
}else{
$id_parent ='item_'.$arr_menu[1];
}
sc_appmenu_add_item(
'menu_dyn_menu',
$id_item,
$id_parent,
$arr_menu[2],
$arr_menu[3],
"","","",""
);
}
as the loop adds it will only do so per your criteria.