> ## Content Index
> Fetch the complete content index at: https://getpublii.com/dev/llms.txt
> Use this file to discover other available public pages before exploring further.

# {{orderby}} helper

- URL: https://getpublii.com/dev/orderby-helper/
- Published: 2017-12-19T10:07:02.658Z
- Updated: 2024-03-04T07:44:28.897Z
- Description: {{orderby}} is a helper similar to the {{reverse}} helper - it changes the ordering of the specific collection using your params. Additionally, it supports an…
- Author: Tomasz Dziuda
- Tags: Helpers

**{{orderby}}** is a helper similar to the [{{reverse}}](#INTERNAL_LINK#/post/95) helper - it changes the ordering of the specific collection using your params. Additionally, it supports an extra parameter, *langForLocaleCompare*, enabling locale-sensitive sorting based on the specified language code.

Syntax:

```handlebars
{{orderby collection field direction [langForLocaleCompare]}}
```

Example:

```handlebars
{{#each @website.contentStructure.tags}}
   {{#checkIf this.name '===' 'test'}}
      {{orderby this.posts 'id' 'DESC' 'pl'}}
      {{#each this.posts}}
         {{title}}
      {{/each}}
      {{orderby this.posts 'id' 'ASC' 'pl'}}
   {{/checkIf}}
{{/each}}
```

In the above example, we reverse posts connected with a specific tag using their ID and apply locale-sensitive sorting according to the Polish language ('pl'). This ensures that sorting considers language-specific rules, enhancing the accuracy and relevance of sorted data for multilingual websites.

**Important!** You should restore the original ordering after the use of the modified output. That's why we use the **{{orderby}}** helper two times, including after locale-specific sorting operations.
