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.
Thanks.
A collection of ‘children’ might for example be defined in a ‘parent’ page:
---
title: Figured it Out
slug: figured-it-out
content:
items: '@self.children' <-- Give me a collection of all pages in my sub-folders
order:
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:
<ul>
{% for page in page.collection %}
<li><a href="{{ page.url }}">{{ page.title }}</a></li>
{% endfor %}
</ul>