Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

How to make a page list in Grav

Started by Muut Archive 10 years ago · 2 replies · 491 views
10 years ago

Hello all. Just getting deeper into GRAV and loving what I'm seeing. However, I can't wrap my head around how to get GRAV to spit out what I'd call a "Page List" of page, like a form of navigation. For example, let's say my homepage at the root, 5 second level pages, each with 5 child pages (third level). On my homepage, I'd want to show 5 columns, with each column containing 1 second level page and it's 5 child pages under it.
Pretty simple, but I'm totally stumped as to how to do so in GRAV. I tried enabling Twig on the homepage, then this code (I used my actual slug tho):
[code]
{% set collection = page.evaluate([{'@page.children':'/page-1-second-level'}]) %}
[/code]

No dice.

Anyone care to give me a clue?
Thanks in advance!

10 years ago

Duh. Thanks for the brevity and clarity. I'm getting the hang of this GRAV thing I think...

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1359 9 years ago
Archive · by Muut Archive, 9 years ago
2 936 9 years ago
Archive · by Muut Archive, 9 years ago
2 4066 9 years ago
Archive · by Muut Archive, 9 years ago
1 2955 9 years ago
Archive · by Muut Archive, 9 years ago
3 1121 9 years ago