Include custom anchor-menu

Hi, i want to include in some pages a html anchor menu like you may know it from wikipedia. I want to include it into my twig-tamplate, but the file is always different.

Now in my noob logic i would have solved it like this:

{% include 'partials/menues/(page.header.menuid).md' %}

–> Yeah that doesn’t work.

Second option would be to place a menu.md alongside with the text.md inside the page folder and include it by default. But i have no idea how to solve that.

the menu.md looks like this:

<div class="menu" markdown="1">

+ [**bulletpoint 1**](#headline-1)
    + [subpoint 1](#sub-headline-1)
    + [subpoint 2](#sub-headline-2) 
    + [subpoint 3](#sub-headline-3)
 + [**subpage 1**](/cathegory/subpage/)
    + [subpage-anchor 1](/cathegory/subpage#headline-1)
    + [subpage-anchor 1](/cathegory/subpage#headline-2)
    + [subpage-anchor 1](/cathegory/subpage#headline-3)
	+ [sub-subpage 1](/cathegory/subpage/secondpage-1)
 + [**Bulletpoint 2**](#headline-2)
etc. etc. etc. 
</div> 

Any Ideas?

THX!

Niko

You really can’t have two markdown files in the same folder. The only exception to this is when you have multilang enabled, and then you can have multiple pages reprenting each language.

You could however have a child folder of the page containing a menu that you include. However, I have done this manually in the past in the Grav docs by just including a menu at the top of the page:

https://raw.githubusercontent.com/getgrav/grav-learn/develop/pages/04.plugins/03.event-hooks/docs.md

I use the Anchor plugin to automatically add anchors to each header.