AdminLTEBundle
AdminLTEBundle copied to clipboard
Fix the KnpMenu template
Description
ATM, the KnpMenu doesn't work. Note : Knp Breadcrumb neither..
Result with the knp_menu.md example:
- Item
headerdoesn't display :x: - Item
headerhave a bad style :x: - Item parent (with child) have/need link :x:
- Badges and arrow from items are wrongly positioned :x:
- Wrong badge color used :x:
- No animation from the arrow when opening an item :x:

I've updated the template to match the AdminLTE 3 menu.
Template update (nothing too fancy):
- Changed
header item typeclass - Add
item.labelto header item display - Changed
<a>for item with child (remove 'route' required param) - Changed badge item position & arrow item position
⚠️ Need to change your KnpMenuBuilderSubscriber.php for header items type from header to nav-header ⚠️
->setAttribute('class', 'header'); ❌
->setAttribute('class', 'nav-header'); ✔️
DOC update:
- Changed
Header itemclass - Remove
routeparam for item with child - Changed badge color class
- Add more generic examples with 'level' system
Result after FIX:

Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing functionality to change)
Checklist
- [x] I updated the documentation (see here)
- [x] I agree that this code is used in AdminLTEBundle and will be published under the MIT license
ℹ️ Note ℹ️
I want to add the nav-legacy and nav-child-indent class to the menu.
The best way I've found to do it is inside KnpMenuBuilderSubscriber.php:
$menu->setChildrenAttribute('class', $menu->getChildrenAttribute('class') . " nav-legacy nav-child-indent");
Is that correct ?
Please note that I can merge, but not answer your question as I am neither using this branch nor the KnpMenu.
I am neither using this branch nor the KnpMenu.
I can see from your Demo Repo that you have a Knp Subscriber.
Did you do your tests from there for Knp ?
Yes, I only used KNP in the demo app. But I guess many test/use cases were not implemented there.
Closing: I will archive this repo now