GitHub Download

{{orderby}} helper

{{orderby}} is a helper similar to the {{reverse}} helper - it changes the ordering of the specific collection using your params.


{{orderby collection field direction}}


{{#each @website.contentStructure.tags}}
{{#checkIf '===' 'test'}}
{{orderby this.posts 'id' 'DESC'}}
{{#each this.posts}}
{{orderby this.posts 'id' 'ASC'}}

In above example we will reverse posts connected with a specific tag using their ID.

Important! You should restore the original ordering after use of the modified output. That's why we are using the {{orderby}} helper two times.


Get the latest Publii news, updates and more delivered directly to your email inbox

You can change your mind at any time by clicking the unsubscribe link in the footer of any email you receive from us, or by contacting us at By clicking below, you agree that we may process your information in accordance with our Privacy Policy.