I Would like to implement a slightly changed treemenu. I would like to see all top-menu entries but only the active submenu and all subsubmenus of the active sub menu. If i am on the top level i can only see the topmenu entries.
Is this possible?
Thank you very much for your help. I am really new to Kirby and i didn’t find a solution yet.
Thank you very much! It works as intended. Now i will have a look at how you did it . the css part is no problem, the part with the php is a bit more tricky.
Best Regards
Florian
I have found a solution that does everything without the CSS Part. Its a Treemenu that only shows the submenus and subsubmenus of the active main menu item. My approach was to change
<?php if($p->hasChildren()): ?>
to
<?php if($p->hasChildren() and $p->isOpen()): ?>
this has the advantage of only rendering what i really need. That is all the active Menu items and all sub- and subsubmenu items that are active. And it does not need any css.
Maybe someone need something like this too. so here is the full code: