Navigation for both modular and standard pages

Hello, I am trying to modify default Antimatter theme to have navigation for both modular and standard pages, i.e. such structure:


and to be able to see in menu all pages modular and standard and navigate among them freely. I experimented with page collections but no success. Any help/ideas/examples?

The navigation is entirely built by the theme, with some Twig logic. Generally themes list all pages, modular childs excluded. Except on the modular page itself, where the menu can be switched to the modular childs list.

The navigation code is quite easy to read: you can tweak that to suit your needs.

Hello flaviocopes, first I’d like to stress that I started to use Grav and I really like it, thank to the folks who build it. Now I’m fiddling around with the same issue above. I read and tweak the twig files, but I think there must be a simpler solution. It seems you know it. Can you explain how to switch the menu to the modular child list. I searched for something like that but obviously I missed it. Thank You in advance.

BTW in this forum I’m missing the date of the posts.

What is the need? You want, on a modular page, the normal menu, and beside it, the menu of the on-page sections? Make a screenshot so I can visualize it

Exactly, that’s what I’m looking for. Can’t visualize it at the moment, but if you still need it, I can do it tomorrow.

Hello flaviocopes,
here is a visualization of what I’m looking for:


menubar           on-page-1   on-page-2   other-page


blabla etc.


even more blabla

on-page-* are the menu items/anchors of the modular pages of the current page, other-page is the menu item, which links to another page.

I hope, this makes my point clearer. Meanwhile I was looking at the bootstrap theme’s modular.html.twig template, which gave me a hint in using to access the modular files for creating a menu item, but I’m still struggling to get all together working.