Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Random page from collection

Started by Usk70 9 years ago · 1 replies · 1138 views
9 years ago

Given a collection -i.e.-:

page.find('/blog').collection({'items': '@self.descendants','order': {'by': 'date','dir': 'desc'}})

Is it possible to get a random page from that collection inside a twig template?

Thanks,

Suggested topics

Topic Participants Replies Views Activity
Support · by gravinator, 1 month ago
5 441 10 minutes ago
Support · by stell, 7 days ago
4 235 5 days ago
Support · by Gravver, 2 weeks ago
6 278 1 week ago
Support · by Marcel, 4 weeks ago
2 337 1 week ago
Support · by blu3prince, 2 weeks ago
1 252 2 weeks ago