> ## Documentation Index
> Fetch the complete documentation index at: https://docs.doczilla.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Available helpers

> Discover Handlebars helpers for efficient, logic-less templating.

[Handlebars](https://handlebarsjs.com/) supports the use of helpers, which are custom functions that can be called within templates to perform specific transformations or logic based on the template data.

## Build-in Helpers

Handlebars provides several built-in helpers which can be used to add logic to your templates. Here are some of the commonly used ones:

1. **if**: Conditionally includes a block of template content.

```handlebars theme={null}
{{#if condition}}
   Content to display if `condition` is true.
{{/if}}
```

2. **unless**: The inverse of `if`. Includes a block of content if the expression evaluates to false.

```handlebars theme={null}
{{#unless condition}}
  Content to display if `condition` is false.
{{/unless}}
```

3. **each**: Iterates over an array, rendering the block once for each item.

```handlebars theme={null}
{{#each items}}
  {{this}}
{{/each}}
```

4. **with**: Provides a new context for the block within its current scope.

```handlebars theme={null}
{{#with person}}
  <p>{{ name }}</p>
{{/with}}
```

## Additional helpers

In addition to the built-in helpers provided by Handlebars, we have added a couple more custom helpers to cater
to specific needs and enhance the templating capabilities.

1. **compare**: Compares two values using a specified operator.
   Available operators are: `==`,`===`,`!=`,`!==`,`>`,`>=`,`<`,`<=`,`||` and`&&`

```handlebars theme={null}
{{#compare prop "===" propB}}
  Content to display if `prop === propB` is true.
{{/compare}}
```

2. **json**: Converts an object into a JSON string.
   Useful if you need to, for example, render charts with a JSON representation of your data. Checkout [our reports example](/examples/pdf-html-reports) to see it in action.

```handlebars theme={null}
<script>
  var chartData = {{{json chartVariable}}}
</script>
```

<CardGroup cols={1}>
  <Card title="Request additional helpers" icon="lightbulb" href="https://github.com/Doczilla-APP/issues/issues/new?assignees=&labels=enhancement&projects=&template=2.feature.yml&title=%5BFEATURE%5D%3A+New+Handlebars+helper" horizontal>
    Request additional helpers to enhance functionality and improve your templating experiences.
    Your suggestions are valuable to us.
  </Card>
</CardGroup>
