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
  • Identifier
  • Erlang/OTP

as_atom

Module

mod_base

Convert a value to an Erlang atom.

Atoms are represented in the template language as strings between backticks, `like this`. Some template function require their arguments to be atoms, and this filter helps in converting any value to such an atom:

{{ "foobar"|as_atom }}

evaluates to the atom foobar.

Edit on GitHub

Related documentation

Filters

slugify

Converts a text into a slug.

Filters

md5

Translates a string to a md5 hex value.

Filters

sha1

Translate a string to a sha1 hex value.

Filters

gravatar_code

Calculate the gravatar code for an e-mail address:

Filters

to_name

Map a string to a name . That is a lowercased string with only [a-z0-9_] characters.

Filters

floor

Round down a floating point value.

Filters

to_boolean

Convert the input to a boolean value.

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

truncatechars

Truncate a text to a maximum length in characters.

GitHub © 2026 Zotonic