Filters

Filters transform template variables before they are rendered.

Binaries
first last length to_binary
Booleans
yesno
Dates
add_hour add_day add_month add_week add_year date date_range datediff eq_day in_future in_past ne_day sub_hour sub_day sub_month sub_week sub_year timesince…
Encryption
md5 sha1
Character escaping
brlinebreaks escape escape_check escape_ical escape_link escapejs escapejson escapexml fix_ampersands force_escape linebreaksbr slugify unescape urlencode…
Forms
pickle
HTML
show_media striptags truncate_html sanitize_html sanitize_url urlize embedded_media without_embedded_media render merge_tags
Lists
after before chunk exclude filter first flatten_value group_by index_of is_list join last length make_list member nthtail random randomize range reversed slice…
Mailing list
inject_recipientdetails mailinglist_recipient_key_decode
Menu
menu_flat menu_ids menu_is_visible menu_expand menu_rsc menu_subtree menu_trail
Miscellaneous
gravatar_code ip2country ip2geo is_letsencrypt_valid_hostname format_dispatch_controller_option format_dispatch_path_element
Numbers
filesizeformat format_duration format_integer format_number format_price is_even is_number max min minmax rand round round_significant to_integer…
Regular Expressions
match replace
Resource lists
group_firstchar group_title_firstchar is_a is_not_a is_visible media_for_language
Resources
admin_merge_diff content_type_label content_type_urls summary temporary_rsc
Strings
append capfirst center filesizeformat format_duration format_integer format_number format_price insert is_valid_email length ljust log_format_stack lower…
Survey
survey_answer_split survey_any_correct_answer survey_any_wrong_answer survey_as_pages survey_is_stop survey_is_submit survey_is_pagebreak_submit…
Translation
is_rtl language language_dir language_sort language_sort_localized media_for_language set_url_language trans_languages trans_filter_filled translation…
Tuples
element
URLs and links
is_site_url url url_abs sanitize_url is_letsencrypt_valid_hostname urlize escape_link urlencode urldecode parse_url
Variables
as_atom default if if_undefined is_defined is_undefined make_value pprint to_binary to_integer to_json from_json

Controllers Reference Tags

All Filters

add_day

See also

add_hour

See also

add_month

Adds a month to a date. The value must be of the form {{Y,M,D},{H,I,S}} .

add_week

Adds a week to a date. The value must be of the form {{Y,M,D},{H,I,S}} .

add_year

Adds a year to a date. The value must be of the form {{Y,M,D},{H,I,S}} .

after

Return the first element after another element in a list. For example:

append

See also

as_atom

Convert a value to an Erlang atom.

before

Return the first element before another element in a list. For example:

capfirst

See also

center

See also

chunk

See also

date

See also

datediff

See also

date_range

See also

default

See also

element

See also

eq_day

See also

escape

See also

escape_ical

See also

escapejs

See also

escapejson

See also

escape_link

See also

escapexml

Escape the value for insertion in xml output.

exclude

See also

filesizeformat

This filter formats a numeric value as KB, MB etc. This filter can be used to display a number of bytes in a human…

filter

See also

first

See also

flatten_value

Flatten a list to a comma separated string.

format_dispatch_controller_option

Format dispatch controller options.

format_dispatch_path_element

Format dispatch path element so variables will be more visible.

from_json

Parse a string as a JSON (JavaScript Object Notation) value. The returned value can be processed futher.

gravatar_code

Calculate the gravatar code for an e-mail address:

group_by

Groups items of a list by a property.

if

See also

index_of

See also

in_future

See also

inject_recipientdetails

Adds recipient query string details to hyperlinks.

in_past

See also

insert

See also

ip2country

Maps an IP address to a country using the MaxMind GeoIP2 database.

ip2geo

Maps an IP address to information about that country.

is_a

See also

is_defined

See also

is_even

Test if an integer value is even:

is_list

Test if a value is a list:

is_not_a

See also

is_number

Test if a value is a number (integer or floating point):

is_rtl

See also

is_site_url

See also

is_visible

See also

join

See also

language

See also

language_dir

Return rtl or ltr depening on the direction of the language.

language_sort

Sort a list of language codes or map with languages on their sort key. Return a list of {Code, LanguageProps} pairs.

language_sort_localized

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

last

See also

length

Returns the length of the value.

ljust

See also

log_format_stack

Escapes and formats a Javascript string with a stack trace to readable HTML.

lower

See also

mailinglist_recipient_key_decode

Used on the mailing list subscriptions page where users and recipients can unsubscribe from mailinglists.

make_list

Forces the value to a list.

match

Match a value with a regular expression.

max

See also

md5

Translates a string to a md5 hex value.

member

Finds a value in a list.

menu_expand

Takes a menu, or a menu resource id, and adds all haspart objects connected to the menu ids.

menu_flat

See also

menu_ids

See also

menu_is_visible

Filters a list of menu items on visibility and existance. Only top-level menu items that are both visible and exist are…

menu_rsc

Return the menu to be displayed with a resource.

menu_trail

See also

merge_tags

A mail-merge like filter where tag-expressions in a text are replaced with the value of their evaluation.

min

See also

minmax

See also