# yesno

Source: https://zotonic.com/docs/1810/yesno

URI: https://zotonic.com/id/1810

Language: en



Show a boolean value as a text.

Given a string mapping values for `true`, `false` and (optionally) `undefined`, returns one of those strings according to the value.

Non-empty values are converted to their boolean value first using `z_convert:to_boolean/1`.

Example:

```django
{{ 1|yesno:"ja,nee" }}
```

Will output “ja”; this:

```django
{{ 0|yesno:"ja,nee" }}
```

Will output “nee”.

yesno accepts these values:

| Value     | Argument        | Output  |
| --------- | --------------- | ------- |
| true      | “yeah,no,maybe” | “yeah”  |
| false     | “yeah,no,maybe” | “no”    |
| undefined | “yeah,no,maybe” | “maybe” |
| undefined | “yeah,no”       | “no”    |

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/1810?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/1810?language=en>)
