Remove modular item from nav

I have been slamming my head against a wall on how to remove a particular modular page from the nav. I made the homepage hero of the site it’s own modular section to make it easily updatable through the admin console, but of course it shows up as a nav item. Is there anyway in the YAML front matter to say “hey don’t show this module in the nav” or do I have to do some fancy twig to make it disappear? I have also toyed with the idea of making it a partial and not part of the modular page set up, but not possible to edit for the person I am delivering this site to.

Depends on the theme used, in Antimatter you can set onpage_menu: false in the page header.

In Antimatter theme for example, there is a special onpage_menu option that triggers a loop in the templates/modular.html.twig file. This is what is looping over the modular items and building the onpage menu.

You could theoretically use a flag in each modular page header to determine if it should be included in this loop or not. Then you simply check this value as you loop.

That way you can skip certain modular pages so they don’t show up in that onpage menu.

Perfect, makes sense. I will play with that. Thank you.