Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
menu system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
13 Feb 2015 at 01:07 UTC
Updated:
4 Mar 2015 at 13:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
joelpittetComment #2
nitvirus commentedHi,
So I just have to Remove .leaf/.menu-item--leaf from menu CSS components and upload the patch.
Could you please help me in writing the example: what exactly needs to there in example?
Thanks,
Nit
Comment #3
joelpittet@nitvirus yes just remove leaf from where it's set in the CSS and the PHP and comments referencing it if there are any.
To add it back, I'd look at the menu-tree.html.twig and see how you can acheive the same thing inside the template. Something like counting the children == 0 then adding a class using attributes.addClass() in twig should do the trick.
@mortendk, may be around to help as well, ask for him on IRC.
Comment #4
pjbaertI removed the .leaf reference out the MenuLinkTree.php file.
I did find a reference to .leaf class in Seven theme but I don't think removing this breaks anything.
I'm still working on the example because I noticed that the menu-tree.html.twig was removed in #1777332: Replace theme_menu_link() and menu-tree.html.twig with a single Twig template
Comment #7
joelpittetThanks @pjbaert, There is one more reference in the book module. Could you do a search for any other reference to leaf in core?
I know there is a tabledrag-leaf, that can be ignored for the scope of this patch.
Comment #8
drupalninja99 commentedHere is an updated patch with the leaf reference removed from the book module.
Comment #9
kepford commentedUpdated the patch to remove all references from the Book module.
Comment #10
davidhernandezI'm not seeing any other references to the leaf class so that's good. We just need the example text.
Comment #11
pjbaertI think this example should cover this.
This doesn't reproduce the old behaviour since the 'below' variable is limited to the 'maximum number of menu levels to display' we set in the menu block configuration.
In my opinion this is the right behaviour since it's not displaying any children elements.
Comment #12
pjbaertComment #13
joelpittet@pjbaert Thank you! That looks like what I would do!
Maybe we can get @mortendk to test it out.
Comment #14
mortendk commentedlemme grap
Comment #15
mortendk commentedOk after playing a bit with it and getting the menu to crash on me hard, i rewrote #11 & added the only leaf class there should ever be ;)
menu.html.twig
This is a screenshot from d8 right now without the menu cleanup & this patch to remove the .leaf that are flying around (see what i did there ... )
Comment #16
mortendk commentedungraps + bonus points for knowing where the leaf reference is coming from
Comment #17
joelpittetBeauty:) Much simipler approach and doesn't needlessly add a class that is rarely if ever used!
We just need to find a documentation page to add your example to it after commit. Thank you all!
Comment #18
davidhernandezMaybe a change record or add the sample text to this issue summary and then add a line here? https://www.drupal.org/node/2356951
Comment #19
joelpittetComment #20
pjbaertI'm getting the reference @mortendk
Isn't it the scene from Serenity where Hoban 'Wash' get's killed?
Comment #21
mortendk commented@pjbart ! yes +1 in epic geek points ;)
Comment #22
alexpottLet's put this in a CR then...
Comment #23
joelpittetAdded https://www.drupal.org/node/2428043
Comment #24
alexpottSorry I'm going to be a pain in the ... can we merge the CR for #2422363: Rewrite the menu CSS components inline with our CSS standards with CR for this one? Less CRs is a good thing and these are on the same topic.
Comment #25
davidhernandezI merged the CRs.
Comment #26
alexpottWith the changes in #2422363: Rewrite the menu CSS components inline with our CSS standards isn't a leaf also...
.menu-item:not(.menu-item--expanded):not(.menu-item--collapsed)
Let's publish the CR after the other issue goes in.
CSS and templates are not frozen in beta. Committed 9e21230 and pushed to 8.0.x. Thanks!