Parent menu item list parents


This cant be this hard. All I want to do is have it so that a main menu item is clicked on it give a list of the child pages. Ive done this in a few other CMS. In fact here is my current one, but I want to move from Joomla/mySQL to flat Grav. Here it is in Joomla My current Joomla

Ive seen several code snippets in here to make this happen, but none of them worked or made enough sense to me to figure it out.


@smegnl It sounds like you are looking for collections: A collection of pages having some commonality.

The documentation has a dedicated section on collections:

A collection of ‘children’ might for example be defined in a ‘parent’ page:

title: Figured it Out
slug: figured-it-out
    items: '@self.children'   <-- Give me a collection of all pages in my sub-folders
        by: date
        dir: desc
    limit: 10                 <-- Don't give me the whole list, but sets of 10 with pagination
    pagination: true

#Figured it Out
Click on a topic....

In your page’s Twig template you can then create a list as follows:

{% for page in page.collection %}
   <li><a href="{{ page.url }}">{{ page.title }}</a></li>
{% endfor %}

Hope this points you in the right direction…


@smegnl Just wondering if you have been able to create any progress…


I got it using this plugin.