Skip to content
Zotonic
  • Start
  • Cookbook
  • Reference
  • Releases

Live search

Search across all Zotonic content

Type at least two characters

Results are matched against titles, summaries and topics as you type.

Filters · mod_base
  • Reference
  • Frontend developer
  • Template filter
  • Transform
  • Boolean

to_boolean

Module

mod_base

Convert the input to a boolean value.

Example:

{{ "123"|to_boolean }}

Results in the boolean value true.

This filter uses the z_convert:to_bool/1 function.

Edit on GitHub

Related documentation

Filters

survey_is_history_back

Test whether a survey respondent may return to the previous page in a history.

Filters

is_user

Test if a resource is a user.

Filters

floor

Round down a floating point value.

Filters

survey_is_save_intermediate

Check if the given survey is configured to save intermediate results. Always returns a boolean value.

Filters

default_if_none

Provide an alternative value in case a value is undefined.

Filters

default_if_undefined

Provide an alternative value in case a value is undefined.

Filters

language_sort_localized

Sort a list of language codes or map with languages on their localized name in the currently selected language. This is useful for…

Filters

survey_is_pagebreak_submit

Check if a list of questions contains a pagebreak block with an unconditional submit.

Filters

truncatechars

Truncate a text to a maximum length in characters.

GitHub © 2026 Zotonic