[SOLVED] Remove Item from Menu |
10/16/2024 12:31:05 PM |
PHPRunner General questions | |
A
asawyer13 authorDevClub member
I want to remove an menu item on the Welcome Page. Do I put the code in the Welcome Page Before Process Menu or the Before DIsplay and what is the proper syntax if I want to remove item id 1? Thanks |
|
C
|
copper21 10/16/2024 |
Alan, Click on the menu item you want to remove. On the right side under "welcome_item" you have the option to "remove". If you want to keep the item, but just want to hide it, click the question mark next to the item id field which will bring up a small pop-up window that tells you where to put the hide code. |
A
|
asawyer13 authorDevClub member 10/16/2024 |
I do want to hide only in specific instances, but I don't have a question mark next to the ID in the Menu Item Editor. I just have a button that says Copy Alan |
![]() |
Sergey Kornilov admin 10/16/2024 |
I guess some screenshots are in order here. Everyone has a question sign next to Item ID. |
C
|
copper21 10/16/2024 |
Can you provide a screenshot of the page you are talking about? |
A
|
asawyer13 authorDevClub member 10/16/2024 |
Here you go. Alan |
C
|
copper21 10/16/2024 |
Alan, I have attached some screenshots. You indicated that you wanted to hide a menu item on the welcome page. This should get you there. Go to the Designer Tab. Then click Common Pages in the Table list on the left. Now click the menu item you want to hide. On the right hand side you will now see the question mark nexst to the item id area. Click the question mark and a pop-up will show up. Use the code I highlighted in the events under Welcome Page->Before Displa
|
![]() |
Davor GeciDevClub member 10/16/2024 |
Or if you want to hide a menu item from the left main menu, maybe this could help:
Then in the Javascript OnLoad event you can use this code after you identified the id of the element:
|
A
|
asawyer13 authorDevClub member 10/16/2024 |
Maybe I do things more complicated than I need to. I blank out my welcome page, will probalby eventually put a dashboard on it, and I use Top Menus. So I want to hide the menu item on the top menu for some users. Alan |
C
|
copper21 10/16/2024 |
Alan, Click on the menu item you want to hide. Get the id number of it. From your screenshot it looks like it has an id of 1. Go to events. Once in events go to the bottom "Modify Menu" You should see a code like this: if( $menu->name() == "main" ) { } Add the following code inside of the brackets to look like this: if( $menu->name() == "main" ) { $menu->removeItem(1); |
A
|
asawyer13 authorDevClub member 10/16/2024 |
That worked perfectly. I never new that event existed. You learn something every day. Thanks |