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

# {{#getAuthors}} helper

- URL: https://getpublii.com/dev/getauthors-helper/
- Published: 2022-03-22T16:47:12.888Z
- Updated: 2024-02-09T10:35:28.346Z
- Description: {{#getAuthors}} is a helper used to retrieve authors data regardless of the current context. Syntax: {{#getAuthors "AUTHOR\_ID1,AUTHOR\_ID2,AUTHOR\_ID3" "before" "after"}} ... {{/getAuthors}} Example: {{#getAuthors "1,2,3" "<ul>"…
- Author: Tomasz Dziuda
- Tags: Helpers

**{{#getAuthors}}** is a helper used to retrieve authors data regardless of the current context.

Syntax:

```handlebars
{{#getAuthors "AUTHOR_ID1,AUTHOR_ID2,AUTHOR_ID3" "before" "after"}}
...
{{/getAuthors}}
```

Example:

```handlebars
{{#getAuthors "1,2,3" "<ul>" "</ul>"}}
<li>
    {{ name }} ({{postsNumber}})
</li>
{{/getAuthors}}
```

Authors are ordered by the ID order in the string.

You can also use the **@index** variable to detect the author number in the specified collection:

```handlebars
{{#getAuthors "1,2,3" "<ul>" "</ul>"}}
<li>
    {{ name }} ({{postsNumber}})
    {{#checkIf @index '==' 0}}
    <small>IT'S THE FIRST ELEMENT!</small>
    {{/checkIf}}
</li>
{{/getAuthors}}
```

The second parameter creates HTML prefix, the third parameter creates HTML suffix for the generated output.

**IMPORTANT:** It requires availability of the `@website.contentStructure` global variable

It is possible to combine querystring options with theme option values using the [concatenate](#INTERNAL_LINK#/post/125) helper:

```handlebars
{{#getAuthors (concatenate @config.custom.authorsDropdown) "<ul>" "</ul>"}}
```
