Twig Help

I have so far failed to find any documentation on the twig functions and filters that appear to be custom in Grav. More specifically order() which I have found among the twig recipes, but can’t successfully modify to order by anything else but date.
I am seeking to order listed post by some custom page header. Ideally.
Thanks.

In addition to all of Twig’s default filters and functions, Grav’s are listed here. Themes have an extended set, including orderBy, is that what you are applying, or is the order set through FrontMatter?

Hi Daniel, order is not a Twig filter but a method of the class.

What page.find('/blog').children.order('date', 'desc').slice(0, 5) does is:

  1. call the Grav Page object’s find method to return a page
  2. call that page children
    method, which returns a Collection object
  3. call the order method on the Collection object, which still returns a collection
  4. slice the collection