- Issue created by @thomas.frobieter
As discussed with @anybody, we want to search through the wiki page contents, not only the title. So the mmenu default search is not enough.
Writing an mmenu plugin for ListJS is very likely more complicated then writing a custom sidebar menu and use ListJS directly on this.
- 🇩🇪Germany Anybody Porta Westfalica
@thomas.frobieter do you think you could guide @lrwebks to implement large parts of this under your supervision? I don't think you'll have the time and priority for this in the future, but it would be nice to proceed here to make this more usable.
It seems that List.js does not support nested lists: https://github.com/javve/list.js/issues/505
So ... this is a problem. If I remember correctly, we did not have many alternatives left.
- 🇩🇪Germany Anybody Porta Westfalica
As just discussed, wo have no nested list on contents, just the navigations (anchor links / show-hide triggers) will be nested. So probably this was just a misunderstanding.
@lrwebks: To proceed here we need to implement the nesting logic first.
The goal is to have a nested list like this:
<ul> <li> <a href="#products">Products</a> <ul> <li><a href="#hats">Hats</a></li> <li><a href="#scarfs">Scarfs</a></li> <li><a href="#gloves">Gloves</a></li> </ul> </li> <li> <a href="#employees">Employees</a> <ul> <li><a href="#sam">Sam</a></li> <li><a href="#sarah">Sarah</a></li> <li><a href="#john">John</a></li> <li><a href="#marie">Marie</a></li> </ul> </li> <li><a href="#contact">Contact</a></li> </ul>
So basically the same as Drupal menus. Here is the Twig example of how we (I) will print the menu in the Twig template: https://git.drupalcode.org/project/gin/-/blob/8.x-3.x/templates/navigati...
So a nested wiki list item entry needs to have a "#parent" key, which is the item id of the parent item. The child items should be in a "children" array in the parent item (what Drupal menus call "below").
I don't think we need a separate list for this. For the wiki article list (the full article list), we simply loop through the array, including the nested "children" arrays, and print it as a flat list.
If it is easy for you to provide a separate flattened array for the full article list, I am fine with that. In this case it could be "items" (flat list) and "items_nested".
@lrwebks: Pushed alot of changes, so ensure to pull this before you start.
Trigger me when the nested array is implemented so I can finish the menu implementation.
I only tested with entity entries, not markdown file content. So there may be other things to work out in the template.
The "content" render array in the project-wiki-entry.html.twig is somewhat unusual, as it has no fields as children. You may want to discuss this with @anybody. I am not sure how to proceed there. The problem is that I can't extract certain fields from the content and print them separately (like author or submitted).
- 🇩🇪Germany Anybody Porta Westfalica
Created two follow-ups for the remaining steps to separate them and make them more clear:
✨ Implement the navigation nesting logic Active
🐛 Fix consistent use of "content" variable ActiveSo we can merge this one now to improve the UI. Please note that this contains minor breaking changes in the templates.
- @anybody opened merge request.
Automatically closed - issue fixed for 2 weeks with no activity.