Section id in modular pages

Hi,
maybe a dumb question but difficult to find answers about, due to the search term.
I use a theme that inherits from quark theme on grav 1.7.37.1 and have modular pages.
The question is: in modular pages (in particular hero.md) where the id of the section come from? How the page is built? There’s a flow explanation or images somewhere?
Yes in fact, these are two questions…

Many thanks

I am not a quark user or fan, but from the hero template it looks like the id comes from the header of the modular page.

I am assuming id is an alias for page.header.id just as title is an alias for page.header.title and others. Have you tried adding an id header to hero.md?

Try it and let me know.

yes first thing i tried
id: myid
does not work :frowning:

Ok found the building page system at

so Page.php build the page, but still is not clear for me where the id comes from…

So it wasn’t a dumb question, but generally a good question, with the best chance of a successful response, would involve as much relevant background info as possible. So if you’ve tried something, please mention it in future.

1 Like

Hi, if you’re asking about anchor link IDs, take a look at the modular page template, you will also see how a modular page is build.
Specifically, line 50 for hero block ID (line 32 for nav part), and line 57 for other blocks
<div id="{{ module.menu|hyphenize }}"></div>
So, menu variable is used, which fall-backs to the “title” if “menu” is not set. You can set it through the admin panel or in the .md file of the page.
But if you meant hero section ID, in case of modular page as I see the ID var is unset, due it’s could be multiple hero blocks on one page.

1 Like