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
  • Format
  • Text

center

Module

mod_base

Centers the value in a field of a certain width using spaces.

For example:

{{ value|center:7 }}

When value is hello then the output is _hello_ (with spaces).

Centering only works for single byte character values. At this moment there is no support for multi-byte unicode characters.

Edit on GitHub

Related pages

  • rjust Justifies the value in a field of a certain width to the right, using spaces. →
  • ljust Justifies the value in a field of a certain width to the left, with spaces. →

Related documentation

Filters

humanize_identifier

Convert an underscore-separated identifier to a readable label.

Filters

upper

Translates the value to upper case.

Filters

capfirst

Converts the first character of the value to uppercase.

Filters

lower

Translates the value to lower case.

Filters

ljust

Justifies the value in a field of a certain width to the left, with spaces.

Filters

stringify

Translates atoms, integers and floats to strings. The undefined value is translated to the empty string. Does not translate tuples.

Filters

summary

Extract a summary from a resource.

Filters

rjust

Justifies the value in a field of a certain width to the right, using spaces.

Filters

filter_payment_currency_symbol

Show a payment currency using its preferred symbol or short form.

GitHub © 2026 Zotonic