This PHPMaker 2024 project will show you how to make the Selected Parent Menu Item on Sidebar will always expand its Sub-Menu Items. Please note that Parent Menu Item on Sidebar is the Menu Item that has Sub-Menu Items underneath. It can be on root level, second level, third level, and so forth.
As we have already known, since v2023.13, PHPMaker let us to use the URL for the Parent Menu Item on Sidebar. But not on Navbar. In other words, now the Parent Menu Item on Sidebar can be as the Menu Item itself, and also can be the Dropdown Menu to expand its Sub-Menu Items underneath.
However, in the original PHPMaker 2023, when the Parent Menu Item on Sidebar is active or selected after clicked by End-Users, then it will not automatically expand its Sub-Menu Items. By using this project, that condition will not be happened again. Now it will expand its Sub-Menu Items after clicked on its text.
Now each time the Parent Menu Item is clicked which will be selected or active, then its Sub-Menu Item underneath will automatically be expanded. You will learn how to implement this logic simply by using Server Event.
For example, simply click on Table One text from Sidebar, then you will see the selected Parent Menu Item will expand its Sub-Menu items after the page is loaded. However, if you click on another menu item, and then back click on its left arrow icon next to its text of Table One Menu Item, or in the area out of the text, then it will only expand the Sub-Menu items.
In this example, you will see there are four Parent Menu Items on Sidebar. They are: Table One, Page Two, Page Three, and Page Four. As you can see, when the Parent Menu Item text is clicked which will cause it is active and opened, then it will automatically expand its Sub-Menu Items.
The conclusion, the Parent Menu Item on Sidebar can be as the Menu Item itself when it is clicked on its text, and also can be as the Dropdown Menu item that will expand its Sub-Menu items underneath when it is clicked on its arrow icon next to its text. Both will always expand its Sub-Menu Items.
BONUS: You will also get the trick how to automatically hightlight the Parent Menu Item on Navbar if the Menu Item underneath is selected/active. You will learn how to implement it by using Server Event.
Reviews
There are no reviews yet.