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 →

Random page from collection

Started by Usk70 9 years ago · 1 replies · 1278 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 TomW, 2 weeks ago
8 227 8 hours ago
Support · by alex, 2 months ago
8 667 23 hours ago
Support · by Supple, 5 days ago
1 98 1 day ago
Support · by TomW, 1 week ago
3 159 3 days ago
Support · by TomW, 6 days ago
2 106 5 days ago