Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Page collections: Modular children of another page

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

Hi all, new to Grav and loving it so far. According to the documentation you can access modular children of the current page as a collection with '@self.modular'. Is there a way to access modular children of another page in a similar way? eg. '@page.modular': '/fruit'? I'm aware of grav-plugin-page-inject, but it seems like we should be able to do it via page collections too? Cheers!

10 years ago

There's no built-in way now AFAIK, you can do '@page': '/fruit'and then {% set collection = page.collection().modular() %}in the Twig.

10 years ago

Ah excellent, that'll do the trick. Thanks a lot.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Muut Archive, 10 years ago
1 676 1 week ago
Archive · by Deleted User, 9 years ago
0 3043 9 years ago
Archive · by Muut Archive, 9 years ago
2 1983 9 years ago
Archive · by Muut Archive, 9 years ago
2 5338 9 years ago
Archive · by Muut Archive, 9 years ago
1 4135 9 years ago