Page 1 of 1

Hide Menu Item for admins

Posted: Mon Mar 20, 2023 5:03 pm
by andyrav

Hi
Is there a way to hind a menu item also from admins?

if (CurrentUserLevel() != "1") {
        if ($item->Url == "customerdashboard") {        
			return FALSE;//dont draw it
		}
    }

This is working for non admin just also want to hide form admins too

thanks


Re: Hide Menu Item for admins

Posted: Mon Mar 20, 2023 8:38 pm
by arbei

andyrav wrote:

if (CurrentUserLevel() != "1") {

Then you should not exclude administrators by above.


Re: Hide Menu Item for admins

Posted: Mon Mar 20, 2023 9:55 pm
by andyrav

not sure what you mean, can you post an example please


Re: Hide Menu Item for admins

Posted: Tue Mar 21, 2023 8:54 am
by mobhar

You may try:

if (CurrentUserLevel() == -1) { // admin user level
    if ($item->Url == "customerdashboard") {
        return false; // hide menu item
    }
}