> ## 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.

# {{reverse}} helper

- URL: https://getpublii.com/dev/reverse-helper/
- Published: 2017-12-19T09:58:02.229Z
- Updated: 2024-02-08T09:33:03.916Z
- Description: The {{reverse}} helper is useful if you need to reverse items in a specific collection e.g. tags listing. Syntax: {{reverse collection}} Example: {{#each @website.contentStructure.tags}} {{#checkIf…
- Author: Tomasz Dziuda
- Tags: Helpers

The **{{reverse}}** helper is useful if you need to reverse items in a specific collection e.g. tags listing.

Syntax:

```handlebars
{{reverse collection}}
```

Example:

```handlebars
{{#each @website.contentStructure.tags}}
   {{#checkIf this.name '==' 'test'}}
      {{#if this.postsNumber}}
         {{reverse this.posts}}
         {{#each this.posts}} {{! this output is reversed }}
            {{title}}
         {{/each}}
         {{reverse this.posts}}
      {{else}}
         There are no posts connected with tag name "test"
      {{/if}}
   {{/checkIf}}
{{/each}}
```

**Important!** You should restore original ordering after use of the modified output. That's why our example contains double call of the **{{reverse}}** helper - the first call reverse the order of elements and after getting a reversed output we reverse the collection again to get original ordering.
