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,
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,
as your collection is an array, you could adapt this example to your need:
https://learn.getgrav.org/cookbook/twig-recipes#picking-a-random-item-from-a-translated-array