Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Fix the KnpMenu template #173

Closed
wants to merge 3 commits into from
Closed

Conversation

cavasinf
Copy link
Contributor

@cavasinf cavasinf commented Nov 25, 2021

Description

ATM, the KnpMenu doesn't work.
Note : Knp Breadcrumb neither..

Result with the knp_menu.md example:

  • Item header doesn't display ❌
  • Item header have a bad style ❌
  • Item parent (with child) have/need link ❌
  • Badges and arrow from items are wrongly positioned ❌
  • Wrong badge color used ❌
  • No animation from the arrow when opening an item ❌

KnpMenu

I've updated the template to match the AdminLTE 3 menu.

Template update (nothing too fancy):

  • Changed header item type class
  • Add item.label to 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 item class
  • Remove route param for item with child
  • Changed badge color class
  • Add more generic examples with 'level' system

Result after FIX:
KnpMenu_after

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I updated the documentation (see here)
  • I agree that this code is used in AdminLTEBundle and will be published under the MIT license

- Changed header nav item class
- Add item.label to header
- Changed <a> item with child
- Changed badge position & arrow item position
- Changed Header item class
- Remove `route` param for item with childs
- Changed badge color class
@cavasinf
Copy link
Contributor Author

ℹ️ 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 ?

@kevinpapst
Copy link
Owner

Please note that I can merge, but not answer your question as I am neither using this branch nor the KnpMenu.

@cavasinf
Copy link
Contributor Author

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 ?

@kevinpapst
Copy link
Owner

Yes, I only used KNP in the demo app. But I guess many test/use cases were not implemented there.

@kevinpapst
Copy link
Owner

Closing: I will archive this repo now

@kevinpapst kevinpapst closed this Dec 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants