Hi all !
I’ve just installed grav with learn2 theme and it’s just great !
I’d like to add to a chapter page the list of all the children pages (with link) to make sort of a table of content…
Here’s my page :
In the future, please paste code between --- here in the forum, so the spacing is maintained. As spacing is critical in YAML, it can make a huge difference in outcomes.
Anyway, setting up the content.items in the page header, that page.collection() variable should be available in the Twig template. You should be able to iterate over it. However, remember @self.children only retrieves the first level of pages under this page you define the collection on.
I actually have 2 children pages, but nothing appears on this page.It seems code is OK ?
Maybe the twig template doesn’t take that in account. I’ll check.